From 244f5b0e37407ce2be870abc784fec765c110603 Mon Sep 17 00:00:00 2001 From: Tom Molesworth Date: Wed, 15 May 2024 06:30:16 +0800 Subject: [PATCH] We really want our transports to be ready before we try to apply services --- lib/Myriad/Commands.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/Myriad/Commands.pm b/lib/Myriad/Commands.pm index 5d519605..6b420c4e 100644 --- a/lib/Myriad/Commands.pm +++ b/lib/Myriad/Commands.pm @@ -76,6 +76,14 @@ async method service (@args) { } } + # Ensure we have valid transports in place before we start + for my $type (qw(storage subscription rpc)) { + $log->tracef('Set up transport for [%s]', $type); + my $method = $myriad->config->${\"${type}_transport"}->as_string . '_transport'; + my $instance = $myriad->$method; + await $instance->start if $instance->can('start'); + } + # Load services into Myriad but don't start them yet $log->tracef('Attempt to add services for %s', join ',', @services_modules);