DBD::mysql::st execute failed: Duplicate key name 'minion_jobs_state_idx' at /usr/lib/perl5/site_perl/5.26.1/Mojo/mysql/Migrations.pm line 127. at /usr/lib/perl5/site_perl/5.26.1/Minion/Command/minion/worker.pm line 26. #29
DBD::mysql::st execute failed: Duplicate key name 'minion_jobs_state_idx' at /usr/lib/perl5/site_perl/5.26.1/Mojo/mysql/Migrations.pm line 127.
at /usr/lib/perl5/site_perl/5.26.1/Minion/Command/minion/worker.pm line 26.
code:
plugin Minion => {
mysql => 'mysql://user@127.0.0.1/minion_jobs'
};
app->minion->add_task(poke_mojo => sub {
my $job = shift;
$job->app->ua->get('mojolicio.us');
$job->app->log->debug('We have poked mojolicio.us for a visitor');
});
Perform job in a background worker process
get '/' => sub {
my $c = shift;
$c->minion->enqueue('poke_mojo');
$c->render(text => 'We will poke mojolicio.us for you soon.');
}
Error duplicate key on running worker or enqueue
DBD::mysql::st execute failed: Duplicate key name 'minion_jobs_state_idx' at /usr/lib/perl5/site_perl/5.26.1/Mojo/mysql/Migrations.pm line 127. at /usr/lib/perl5/site_perl/5.26.1/Minion/Command/minion/worker.pm line 26.
code: plugin Minion => { mysql => 'mysql://user@127.0.0.1/minion_jobs' };
app->minion->add_task(poke_mojo => sub { my $job = shift; $job->app->ua->get('mojolicio.us'); $job->app->log->debug('We have poked mojolicio.us for a visitor'); });
Perform job in a background worker process
get '/' => sub { my $c = shift; $c->minion->enqueue('poke_mojo'); $c->render(text => 'We will poke mojolicio.us for you soon.'); }