From 03ad45517ca687afea084efef061667d1ad62cb1 Mon Sep 17 00:00:00 2001 From: Martin McGrane Date: Wed, 16 Aug 2023 13:42:42 +1000 Subject: [PATCH] Provision engines before adding to pool --- src/testpool.jl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/testpool.jl b/src/testpool.jl index 1dd64ea..e6ec1fc 100644 --- a/src/testpool.jl +++ b/src/testpool.jl @@ -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 @@ -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