Skip to content
Snippets Groups Projects
Unverified Commit 1db4f4cd authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

work: give bodged background tasks some time to complete

parent 1184d848
No related branches found
No related tags found
No related merge requests found
...@@ -324,6 +324,15 @@ sub run { ...@@ -324,6 +324,15 @@ sub run {
if ( not $self->app->config->{traewelling}->{separate_worker} ) { if ( not $self->app->config->{traewelling}->{separate_worker} ) {
$self->app->start('traewelling'); $self->app->start('traewelling');
} }
# add_wagonorder and add_stationinfo assume a permanently running IOLoop
# and do not allow Mojolicious commands to wait until they have completed.
# Hence, some add_wagonorder and add_stationinfo calls made here may not
# complete before the work command exits, and thus have no effect.
#
# This is not ideal and will need fixing at some point. Until then, here
# is the pragmatic solution for 99% of the associated issues.
Mojo::Promise->timer(5)->wait;
} }
1; 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment