Skip to content

Commit a659145

Browse files
authored
fix: Run in blocking mode, not just non-blocking (#15)
* fix: Run in blocking mode, not just non-blocking * fix: Corrects the non-blocking mode for pool creation
1 parent e5a0600 commit a659145

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/leopard/nats_api_server.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ def use(klass, *args, &block)
7676
def run(nats_url:, service_opts:, instances: 1, blocking: true)
7777
logger.info 'Booting NATS API server...'
7878
# Return the thread pool if non-blocking
79-
return spawn_instances(nats_url, service_opts, instances) unless blocking
79+
pool = spawn_instances(nats_url, service_opts, instances)
80+
return pool unless blocking
8081

8182
# Otherwise, just sleep the main thread forever
8283
sleep

0 commit comments

Comments
 (0)