shift);
$self->backend->$method(@_);
return $self;
}
sub _dump { local $YAML::XS::Boolean = 'JSON::PP'; Dump(@_) }
sub _iterator {
my ($self, $jobs, $options) = (shift, shift, shift // {});
new job with C<inactive> state. Arguments get serialized by the L</"backend"> (often with L<Mojo::JSON>), so
you shouldn't send objects and be careful with binary data, nested data structures with has
ith arbitrary metadata for this job that gets serialized by the L</"backend"> (often with
L<Mojo::JSON>), so you shouldn't send objects and be careful with binary data, nested data structures with has
package Minion::Command::minion::job;
use Mojo::Base 'Mojolicious::Command';
use Mojo::JSON qw(decode_json);
use Mojo::Util qw(getopt tablify);
has description => 'Manage Minion jobs';
has usage
\@args,
'A|attempts=i' => \$options->{attempts},
'a|args=s' => sub { $args = decode_json($_[1]) },
'b|broadcast=s' => (\my $command),
'd|delay=i' => \$options->{delay},
'
i' => \(my $limit = 100),
'n|notes=s' => sub { $options->{notes} = decode_json($_[1]) },
'o|offset=i' => \(my $offset = 0),
'P|parent=s' => sub { push
self->pg->db->query(
q{UPDATE minion_workers SET inbox = inbox || $1::JSONB WHERE (id = ANY ($2) OR $2 = '{}')},
{json => [[$command, @$args]]}, $ids)->rows;
}
sub dequeue {
my ($self, $id,
$7, $8, $9, $10)
RETURNING id}, {json => $args}, $options->{attempts} // 1, $options->{delay} // 0, $options->{expire},
$options->{lax} ? 1 : 0, {json => $options->{notes} || {}}, $options-
e) = @_;
return !!$self->pg->db->query('UPDATE minion_jobs SET notes = JSONB_STRIP_NULLS(notes || ?) WHERE id = ?',
{json => $merge}, $id)->rows;
}
sub receive {
my $array = shift->pg->db->qu
>render('minion/dashboard', history => $history);
}
sub _history {
my $c = shift;
$c->render(json => $c->minion->history);
}
sub _list_jobs {
my $c = shift;
my $v = $c->validation;
$v->op
_to($c->url_for('minion_jobs')->query(id => $ids));
}
sub _stats {
my $c = shift;
$c->render(json => $c->minion->stats);
}
sub _unlock {
my $c = shift;
my $v = $c->validation;
$v->require
l remove the field. The new values will
get serialized by L<Minion/"backend"> (often with L<Mojo::JSON>), so you shouldn't send objects and be careful with
binary data, nested data structures with has