Understanding interaction between Minion and websocket through events

56 views
Skip to first unread message

Pavel Serikov

unread,
Apr 30, 2018, 7:49:32 AM4/30/18
to Mojolicious
Hi there,

App must notify user through websocket when minion job is finished.

But it doesn't work as expected.

Could someone help to figure out what is wrong? You can write a review directly in commit for convenience.

In general, there are two corresponding problems:

1) Web socket doesn't react on 
$self->on(task_finished => sub {  
but I see in debug log last message of task code: 
$job->app->log->debug('Test minion task '.$job->task.'(id='.$job->id.') finished');

2) Minion Admin UI shows that task is unactive, but according debug log all task code was executed (I see output from last task code string).

Pavel Serikov

unread,
May 2, 2018, 7:04:27 AM5/2/18
to Mojolicious
Figured out what was the issue.
When you have workers running, any new task is automatically performed.

So it's enough to add task like $self->minion->enqueue('some_task') and run at least one worker (in my case I run separate docker container).
After that any new task will started automatically.


понедельник, 30 апреля 2018 г., 14:49:32 UTC+3 пользователь Pavel Serikov написал:
Reply all
Reply to author
Forward
0 new messages