We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When the administrator shuts down the database, then need to restart the command worker after the start of the database.
Maybe add a key in the command line that the worker had not completed its work when the database is not available.
The text was updated successfully, but these errors were encountered:
I'm afraid this feature request is too imprecise to be considered. What exactly is that command-line "key" supposed to do?
Sorry, something went wrong.
I know zero services which need to restart when restart db.
I believe code must look like something like that, but need correctly detect problem of connect to db:
$ git diff diff --git a/lib/Minion/Command/minion/worker.pm b/lib/Minion/Command/minion/worker.pm index f85738e..77e1428 100644 --- a/lib/Minion/Command/minion/worker.pm +++ b/lib/Minion/Command/minion/worker.pm @@ -22,8 +22,15 @@ sub run { my $app = $self->app; my $worker = $self->{worker} = $app->minion->worker; @$self{qw(register repair)} = (0, 0); - eval { $self->_work until $self->{finished} && !keys %{$self->{jobs}}; 1 } - or $app->log->fatal("Worker error: $@"); + until ($self->{finished} && !keys %{$self->{jobs} // {}}) { + eval { $self->_work }; + $app->log->fatal("Worker error: $@") if $@; + if ($@ && $@ =~ m/DBI connect/) { # don't know how correctly determine problem connect to db + sleep 5; + } else { + $self->{finished}++; + } + } $worker->unregister; }
I'm open to accepting a good patch for this, but it needs to be well thought out and take all the different backends into account.
No branches or pull requests
When the administrator shuts down the database, then need to restart the command worker after the start of the database.
Maybe add a key in the command line that the worker had not completed its work when the database is not available.
The text was updated successfully, but these errors were encountered: