From 7202fc4362a53075fd84756b3aba837f90579bcd Mon Sep 17 00:00:00 2001 From: Manager Bot Date: Sun, 27 Nov 2022 01:23:30 +0000 Subject: [PATCH] Now this works? --- Web/lib/MJB/Web/Task/CreateSSLCert.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Web/lib/MJB/Web/Task/CreateSSLCert.pm b/Web/lib/MJB/Web/Task/CreateSSLCert.pm index 710eda6..0c20a41 100644 --- a/Web/lib/MJB/Web/Task/CreateSSLCert.pm +++ b/Web/lib/MJB/Web/Task/CreateSSLCert.pm @@ -27,6 +27,12 @@ sub run ( $job, $blog_id ) { notes => { '_bid_0' => 1 }, }); $job->app->db->admin_jobs->create({ minion_job_id => $id }); + + # Don't exit until the sync job is complete. + while ( $job->app->minion->job( $id )->info->{state} ne 'finished' ) { + $job->append_log( "Waiting for sync_ssl_certs job with id $id to finish." ); + sleep 5; + } $job->note( is_sync_done => 1 );