Skip to content

Commit

Permalink
Provision engines before adding to pool
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcgr committed Aug 16, 2023
1 parent c185c80 commit 03ad455
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/testpool.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ function replace_engine(name::String)

name = TEST_ENGINE_POOL.name_generator(TEST_ENGINE_POOL.next_id)

# Provision the engine if it does not already exist.
TEST_ENGINE_POOL.creater(new_name)

@lock TEST_SERVER_LOCK begin
TEST_ENGINE_POOL.engines[name] = 0
end
Expand All @@ -103,14 +106,14 @@ Add an engine to the pool of test engines. The engine will be provisioned if it
already.
"""
function add_test_engine!(name::String)
# Provision the engine if it does not already exist.
TEST_ENGINE_POOL.creater(new_name)

@lock TEST_SERVER_LOCK begin
engines = TEST_ENGINE_POOL.engines
engines[name] = 0
end

# Provision the engine if it does not already exist.
TEST_ENGINE_POOL.creater(new_name)

return nothing
end

Expand Down

0 comments on commit 03ad455

Please sign in to comment.