Replies: 4 comments
-
I think so far there are only bad solutions. Closest i've ever come to using something like that in development was a recurring timer in the app process that calls |
Beta Was this translation helpful? Give feedback.
-
Thanks! I ended up doing this so that if there are no registered workers (when doing development) then the main app will perform the jobs but also log a warning that it's doing so if the app mode is production. Seems a decent way to go.
|
Beta Was this translation helpful? Give feedback.
-
There's a tool on cpan called App::lrrr, it's literally the morbo restart
engine which restarts any arbitrary program passed in on the command line.
I have been happily using it for several years
…On Sun, Sep 15, 2024, 04:41 Stefan Adams ***@***.***> wrote:
Thanks! I ended up doing this so that if there are no registered workers
(when doing development) then the main app will perform the jobs but also
log a warning that it's doing so if the app mode is production. Seems a
decent way to go.
Mojo::IOLoop->recurring(3 => sub {
my $minion = $app->minion;
my $workers = $minion->workers;
return if $workers->total;
my $inactive = $minion->jobs({states => ['inactive']})->total;
return unless $inactive;
$app->log->warn("No registered workers, performing $inactive jobs in app") if $app->mode eq 'production';
$minion->perform_jobs;
});
—
Reply to this email directly, view it on GitHub
<#2198 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFURPKT7NQHXVJPWMQZO3ULZWTQVJAVCNFSM6AAAAABOHG2GUGVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTANRUHE3DQMI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
That's excellent! Thanks for bringing awareness to that!
On Sat, Sep 14, 2024 at 10:58 PM Veesh Goldman ***@***.***>
wrote:
… There's a tool on cpan called App::lrrr, it's literally the morbo restart
engine which restarts any arbitrary program passed in on the command line.
I have been happily using it for several years
On Sun, Sep 15, 2024, 04:41 Stefan Adams ***@***.***> wrote:
> Thanks! I ended up doing this so that if there are no registered workers
> (when doing development) then the main app will perform the jobs but
also
> log a warning that it's doing so if the app mode is production. Seems a
> decent way to go.
>
> Mojo::IOLoop->recurring(3 => sub {
> my $minion = $app->minion;
> my $workers = $minion->workers;
> return if $workers->total;
> my $inactive = $minion->jobs({states => ['inactive']})->total;
> return unless $inactive;
> $app->log->warn("No registered workers, performing $inactive jobs in
app") if $app->mode eq 'production';
> $minion->perform_jobs;
> });
>
> —
> Reply to this email directly, view it on GitHub
> <
#2198 (comment)>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AFURPKT7NQHXVJPWMQZO3ULZWTQVJAVCNFSM6AAAAABOHG2GUGVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTANRUHE3DQMI>
> .
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***>
>
—
Reply to this email directly, view it on GitHub
<#2198 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAD6K6REVDPHMC7F3GZ2C5TZWUAU3AVCNFSM6AAAAABOHG2GUGVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTANRVGAYDANQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Is there a way to run a Minion worker like morbo -- when the code base changes, the worker auto restarts? Or is there a different way I should be running a Minion worker during development?
Beta Was this translation helpful? Give feedback.
All reactions