Hello community,

here is the log from the commit of package perl-Minion for openSUSE:Factory 
checked in at 2019-02-06 14:06:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Minion (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Minion.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Minion"

Wed Feb  6 14:06:26 2019 rev:46 rq:671597 version:9.09

Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Minion/perl-Minion.changes  2018-11-12 
09:41:15.829202851 +0100
+++ /work/SRC/openSUSE:Factory/.perl-Minion.new.28833/perl-Minion.changes       
2019-02-06 14:06:30.098659264 +0100
@@ -1,0 +2,19 @@
+Mon Feb  4 06:16:16 UTC 2019 - Stephan Kulow <co...@suse.com>
+
+- updated to 9.09
+   see /usr/share/doc/packages/perl-Minion/Changes
+
+  9.09  2019-02-03
+    - Changed result_p method in Minion to pass along the whole job info hash
+      instead of just the job result.
+
+-------------------------------------------------------------------
+Sun Feb  3 06:24:00 UTC 2019 - Stephan Kulow <co...@suse.com>
+
+- updated to 9.08
+   see /usr/share/doc/packages/perl-Minion/Changes
+
+  9.08  2019-02-01
+    - Added EXPERIMENTAL result_p method to Minion.
+
+-------------------------------------------------------------------

Old:
----
  Minion-9.07.tar.gz

New:
----
  Minion-9.09.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-Minion.spec ++++++
--- /var/tmp/diff_new_pack.SbXblF/_old  2019-02-06 14:06:30.674659160 +0100
+++ /var/tmp/diff_new_pack.SbXblF/_new  2019-02-06 14:06:30.674659160 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package perl-Minion
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           perl-Minion
-Version:        9.07
+Version:        9.09
 Release:        0
 %define cpan_name Minion
 Summary:        Job queue
@@ -30,8 +30,8 @@
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildRequires:  perl
 BuildRequires:  perl-macros
-BuildRequires:  perl(Mojolicious) >= 8.03
-Requires:       perl(Mojolicious) >= 8.03
+BuildRequires:  perl(Mojolicious) >= 8.12
+Requires:       perl(Mojolicious) >= 8.12
 %{perl_requires}
 
 %description
@@ -55,10 +55,10 @@
 
 %build
 perl Makefile.PL INSTALLDIRS=vendor
-%{__make} %{?_smp_mflags}
+make %{?_smp_mflags}
 
 %check
-%{__make} test
+make test
 
 %install
 %perl_make_install

++++++ Minion-9.07.tar.gz -> Minion-9.09.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Minion-9.07/Changes new/Minion-9.09/Changes
--- old/Minion-9.07/Changes     2018-10-18 01:23:25.000000000 +0200
+++ new/Minion-9.09/Changes     2019-02-03 15:54:22.000000000 +0100
@@ -1,4 +1,11 @@
 
+9.09  2019-02-03
+  - Changed result_p method in Minion to pass along the whole job info hash
+    instead of just the job result.
+
+9.08  2019-02-01
+  - Added EXPERIMENTAL result_p method to Minion.
+
 9.07  2018-10-18
   - Improved various attributes to use new Mojolicious 8.03 features to avoid
     memory leaks.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Minion-9.07/META.json new/Minion-9.09/META.json
--- old/Minion-9.07/META.json   2018-10-18 01:25:46.000000000 +0200
+++ new/Minion-9.09/META.json   2019-02-03 16:04:49.000000000 +0100
@@ -33,7 +33,7 @@
       },
       "runtime" : {
          "requires" : {
-            "Mojolicious" : "8.03",
+            "Mojolicious" : "8.12",
             "perl" : "5.010001"
          }
       }
@@ -54,6 +54,6 @@
       },
       "x_IRC" : "irc://irc.freenode.net/#mojo"
    },
-   "version" : "9.07",
-   "x_serialization_backend" : "JSON::PP version 2.97001"
+   "version" : "9.09",
+   "x_serialization_backend" : "JSON::PP version 4.00"
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Minion-9.07/META.yml new/Minion-9.09/META.yml
--- old/Minion-9.07/META.yml    2018-10-18 01:25:46.000000000 +0200
+++ new/Minion-9.09/META.yml    2019-02-03 16:04:49.000000000 +0100
@@ -19,7 +19,7 @@
     - inc
     - t
 requires:
-  Mojolicious: '8.03'
+  Mojolicious: '8.12'
   perl: '5.010001'
 resources:
   IRC: irc://irc.freenode.net/#mojo
@@ -27,5 +27,5 @@
   homepage: https://mojolicious.org
   license: http://www.opensource.org/licenses/artistic-license-2.0
   repository: https://github.com/mojolicious/minion.git
-version: '9.07'
+version: '9.09'
 x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Minion-9.07/Makefile.PL new/Minion-9.09/Makefile.PL
--- old/Minion-9.07/Makefile.PL 2018-10-18 01:19:14.000000000 +0200
+++ new/Minion-9.09/Makefile.PL 2019-02-01 17:32:44.000000000 +0100
@@ -28,6 +28,6 @@
       x_IRC => 'irc://irc.freenode.net/#mojo'
     },
   },
-  PREREQ_PM => {Mojolicious => '8.03'},
+  PREREQ_PM => {Mojolicious => '8.12'},
   test      => {TESTS       => 't/*.t t/*/*.t'}
 );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Minion-9.07/lib/Minion/Command/minion/job.pm 
new/Minion-9.09/lib/Minion/Command/minion/job.pm
--- old/Minion-9.07/lib/Minion/Command/minion/job.pm    2018-05-08 
13:44:54.000000000 +0200
+++ new/Minion-9.09/lib/Minion/Command/minion/job.pm    2019-02-02 
03:02:45.000000000 +0100
@@ -5,7 +5,7 @@
 use Mojo::Util qw(dumper getopt tablify);
 
 has description => 'Manage Minion jobs';
-has usage => sub { shift->extract_usage };
+has usage       => sub { shift->extract_usage };
 
 sub run {
   my ($self, @args) = @_;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Minion-9.07/lib/Minion/Command/minion/worker.pm 
new/Minion-9.09/lib/Minion/Command/minion/worker.pm
--- old/Minion-9.07/lib/Minion/Command/minion/worker.pm 2018-09-21 
01:49:17.000000000 +0200
+++ new/Minion-9.09/lib/Minion/Command/minion/worker.pm 2019-02-02 
03:02:45.000000000 +0100
@@ -4,7 +4,7 @@
 use Mojo::Util 'getopt';
 
 has description => 'Start Minion worker';
-has usage => sub { shift->extract_usage };
+has usage       => sub { shift->extract_usage };
 
 sub run {
   my ($self, @args) = @_;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Minion-9.07/lib/Minion/Worker.pm 
new/Minion-9.09/lib/Minion/Worker.pm
--- old/Minion-9.07/lib/Minion/Worker.pm        2018-09-22 17:12:55.000000000 
+0200
+++ new/Minion-9.09/lib/Minion/Worker.pm        2019-02-02 03:02:44.000000000 
+0100
@@ -51,7 +51,7 @@
 }
 
 sub register {
-  my $self = shift;
+  my $self   = shift;
   my $status = {status => $self->status};
   return $self->id($self->minion->backend->register_worker($self->id, 
$status));
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Minion-9.07/lib/Minion.pm 
new/Minion-9.09/lib/Minion.pm
--- old/Minion-9.07/lib/Minion.pm       2018-10-18 01:24:15.000000000 +0200
+++ new/Minion-9.09/lib/Minion.pm       2019-02-03 15:54:42.000000000 +0100
@@ -6,7 +6,9 @@
 use Minion::Job;
 use Minion::Worker;
 use Mojo::Date;
+use Mojo::IOLoop;
 use Mojo::Loader 'load_class';
+use Mojo::Promise;
 use Mojo::Server;
 use Mojo::Util 'steady_time';
 
@@ -20,7 +22,7 @@
 has remove_after  => 172800;
 has tasks         => sub { {} };
 
-our $VERSION = '9.07';
+our $VERSION = '9.09';
 
 sub add_task { ($_[0]->tasks->{$_[1]} = $_[2]) and return $_[0] }
 
@@ -65,8 +67,7 @@
 sub job {
   my ($self, $id) = @_;
 
-  return undef
-    unless my $job = $self->backend->list_jobs(0, 1, {ids => 
[$id]})->{jobs}[0];
+  return undef unless my $job = $self->_info($id);
   return Minion::Job->new(
     args    => $job->{args},
     id      => $job->{id},
@@ -98,6 +99,18 @@
 sub repair { shift->_delegate('repair') }
 sub reset  { shift->_delegate('reset') }
 
+sub result_p {
+  my ($self, $id, $options) = (shift, shift, shift // {});
+
+  my $promise = Mojo::Promise->new;
+  my $cb      = sub { $self->_result($promise, $id) };
+  my $timer   = Mojo::IOLoop->recurring($options->{interval} // 3 => $cb);
+  $promise->finally(sub { Mojo::IOLoop->remove($timer) });
+  $cb->();
+
+  return $promise;
+}
+
 sub stats  { shift->backend->stats }
 sub unlock { shift->backend->unlock(@_) }
 
@@ -128,6 +141,15 @@
   return $self;
 }
 
+sub _info { shift->backend->list_jobs(0, 1, {ids => [shift]})->{jobs}[0] }
+
+sub _result {
+  my ($self, $promise, $id) = @_;
+  return $promise->resolve unless my $job = $self->_info($id);
+  if    ($job->{state} eq 'finished') { $promise->resolve($job) }
+  elsif ($job->{state} eq 'failed')   { $promise->reject($job) }
+}
+
 package Minion::_Guard;
 use Mojo::Base -base;
 
@@ -648,6 +670,41 @@
 
 Reset job queue.
 
+=head2 result_p
+
+  my $promise = $minion->result_p($id);
+  my $promise = $minion->result_p($id, {interval => 5});
+
+Return a L<Mojo::Promise> object for the result of a job. The state C<finished>
+will result in the promise being C<fullfilled>, and the state C<failed> in the
+promise being C<rejected>. This operation can be cancelled by resolving the
+promise manually at any time. Note that this method is EXPERIMENTAL and might
+change without warning!
+
+  # Enqueue job and receive the result at some point in the future
+  my $id = $minion->enqueue('foo');
+  $minion->result_p($id)->then(sub {
+    my $info   = shift;
+    my $result = ref $info ? $info->{result} : 'Job already removed';
+    say "Finished: $result";
+  })->catch(sub {
+    my $info = shift;
+    say "Failed: $info->{result}";
+  })->wait;
+
+These options are currently available:
+
+=over 2
+
+=item interval
+
+  interval => 5
+
+Polling interval in seconds for checking if the state of the job has changed,
+defaults to C<3>.
+
+=back
+
 =head2 stats
 
   my $stats = $minion->stats;
@@ -880,7 +937,7 @@
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright (C) 2014-2018, Sebastian Riedel and others.
+Copyright (C) 2014-2019, Sebastian Riedel and others.
 
 This program is free software, you can redistribute it and/or modify it under
 the terms of the Artistic License version 2.0.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Minion-9.07/lib/Mojolicious/Plugin/Minion/Admin.pm 
new/Minion-9.09/lib/Mojolicious/Plugin/Minion/Admin.pm
--- old/Minion-9.07/lib/Mojolicious/Plugin/Minion/Admin.pm      2018-09-21 
01:29:07.000000000 +0200
+++ new/Minion-9.09/lib/Mojolicious/Plugin/Minion/Admin.pm      2019-02-02 
03:02:46.000000000 +0100
@@ -206,7 +206,7 @@
   # Mojolicious::Lite
   plugin 'Minion::Admin' => {return_to => 'some_route'};
 
-Name of route or path to retrurn to when leaving the admin ui, defaults to 
C</>.
+Name of route or path to return to when leaving the admin ui, defaults to C</>.
 
 =head2 route
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Minion-9.07/lib/Mojolicious/Plugin/Minion.pm 
new/Minion-9.09/lib/Mojolicious/Plugin/Minion.pm
--- old/Minion-9.07/lib/Mojolicious/Plugin/Minion.pm    2018-10-18 
01:24:23.000000000 +0200
+++ new/Minion-9.09/lib/Mojolicious/Plugin/Minion.pm    2019-02-02 
03:02:45.000000000 +0100
@@ -6,7 +6,7 @@
 sub register {
   my ($self, $app, $conf) = @_;
   push @{$app->commands->namespaces}, 'Minion::Command';
-  my $minion = Minion->new(each %$conf)->app($app);
+  my $minion = Minion->new(%$conf)->app($app);
   $app->helper(minion => sub {$minion});
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Minion-9.07/t/pg.t new/Minion-9.09/t/pg.t
--- old/Minion-9.07/t/pg.t      2018-09-21 01:26:49.000000000 +0200
+++ new/Minion-9.09/t/pg.t      2019-02-03 15:49:38.000000000 +0100
@@ -45,12 +45,71 @@
 is $worker->info->{pid}, $$, 'right pid';
 is $worker->unregister->info, undef, 'no information';
 
-# Repair missing worker
+# Job results
 $minion->add_task(test => sub { });
+$worker = $minion->worker->register;
+$id     = $minion->enqueue('test');
+my (@finished, @failed);
+my $promise
+  = $minion->result_p($id, {interval => 0})->then(sub { @finished = @_ })
+  ->catch(sub { @failed = @_ });
+my $job = $worker->dequeue(0);
+is $job->id, $id, 'same id';
+Mojo::IOLoop->one_tick;
+is_deeply \@finished, [], 'not finished';
+is_deeply \@failed,   [], 'not failed';
+$job->finish({just => 'works!'});
+$job->note(foo => 'bar');
+$promise->wait;
+is_deeply $finished[0]{result}, {just => 'works!'}, 'right result';
+is_deeply $finished[0]{notes},  {foo  => 'bar'},    'right note';
+ok !$finished[1], 'no more results';
+is_deeply \@failed, [], 'not failed';
+(@finished, @failed) = ();
+my $id2 = $minion->enqueue('test');
+$promise
+  = $minion->result_p($id2, {interval => 0})->then(sub { @finished = @_ })
+  ->catch(sub { @failed = @_ });
+$job = $worker->dequeue(0);
+is $job->id, $id2, 'same id';
+$job->fail({works => 'too!'});
+$promise->wait;
+is_deeply \@finished, [], 'not finished';
+is_deeply $failed[0]{result}, {works => 'too!'}, 'right result';
+ok !$failed[1], 'no more results';
+$worker->unregister;
+
+# Job results (already finished)
+(@finished, @failed) = ();
+$minion->result_p($id)->then(sub { @finished = @_ })
+  ->catch(sub                    { @failed   = @_ })->wait;
+is_deeply $finished[0]{result}, {just => 'works!'}, 'right result';
+is_deeply $finished[0]{notes},  {foo  => 'bar'},    'right note';
+ok !$finished[1], 'no more results';
+is_deeply \@failed, [], 'not failed';
+
+# Job results (timeout)
+(@finished, @failed) = ();
+$minion->job($id)->retry;
+$minion->result_p($id)->timeout(0.25)->then(sub { @finished = @_ })
+  ->catch(sub                                   { @failed   = @_ })->wait;
+is_deeply \@finished, [], 'not finished';
+is_deeply \@failed, ['Promise timeout'], 'failed';
+Mojo::IOLoop->start;
+
+# Job results (missing job)
+(@finished, @failed) = ();
+$minion->job($id)->remove;
+$minion->result_p($id)->then(sub { @finished = (@_, 'finished') })
+  ->catch(sub                    { @failed   = (@_, 'failed') })->wait;
+is_deeply \@finished, ['finished'], 'job no longer exists';
+is_deeply \@failed, [], 'not failed';
+
+# Repair missing worker
 my $worker2 = $minion->worker->register;
 isnt $worker2->id, $worker->id, 'new id';
-$id = $minion->enqueue('test');
-my $job = $worker2->dequeue(0);
+$id  = $minion->enqueue('test');
+$job = $worker2->dequeue(0);
 is $job->id, $id, 'right id';
 is $worker2->info->{jobs}[0], $job->id, 'right id';
 $id = $worker2->id;
@@ -82,8 +141,8 @@
 
 # Repair old jobs
 $worker->register;
-$id = $minion->enqueue('test');
-my $id2 = $minion->enqueue('test');
+$id  = $minion->enqueue('test');
+$id2 = $minion->enqueue('test');
 my $id3 = $minion->enqueue('test');
 $worker->dequeue(0)->perform for 1 .. 3;
 my $finished = $minion->backend->pg->db->query(
@@ -109,7 +168,7 @@
 ok !$minion->job($id3), 'job has been cleaned up';
 
 # List workers
-$worker = $minion->worker->register;
+$worker  = $minion->worker->register;
 $worker2 = $minion->worker->status({whatever => 'works!'})->register;
 my $results = $minion->backend->list_workers(0, 10);
 is $results->{total}, 2, 'two workers total';
@@ -122,7 +181,7 @@
 is $batch->[1]{pid},       $$, 'right pid';
 ok !$batch->[2], 'no more results';
 $results = $minion->backend->list_workers(0, 1);
-$batch = $results->{workers};
+$batch   = $results->{workers};
 is $results->{total}, 2, 'two workers total';
 is $batch->[0]{id}, $worker2->id, 'right id';
 is_deeply $batch->[0]{status}, {whatever => 'works!'}, 'right status';
@@ -357,7 +416,7 @@
   = $minion->backend->list_jobs(0, 10, {queues => ['does_not_exist']})->{jobs};
 is_deeply $batch, [], 'no results';
 $results = $minion->backend->list_jobs(0, 1);
-$batch = $results->{jobs};
+$batch   = $results->{jobs};
 is $results->{total}, 4, 'four jobs total';
 is $batch->[0]{state},   'inactive', 'right state';
 is $batch->[0]{retries}, 0,          'job has not been retried';
@@ -404,7 +463,7 @@
 is $job->task, 'add', 'right task';
 
 # Retry and remove
-$id = $minion->enqueue(add => [5, 6]);
+$id  = $minion->enqueue(add => [5, 6]);
 $job = $worker->register->dequeue(0);
 is $job->info->{attempts}, 1, 'job will be attempted once';
 is $job->info->{retries},  0, 'job has not been retried';
@@ -428,7 +487,7 @@
 ok $job->remove, 'job has been removed';
 ok !$job->retry, 'job not retried';
 is $job->info, undef, 'no information';
-$id = $minion->enqueue(add => [6, 5]);
+$id  = $minion->enqueue(add => [6, 5]);
 $job = $minion->job($id);
 is $job->info->{state},   'inactive', 'right state';
 is $job->info->{retries}, 0,          'job has not been retried';
@@ -440,20 +499,20 @@
 ok $job->fail,   'job failed';
 ok $job->remove, 'job has been removed';
 is $job->info,   undef, 'no information';
-$id = $minion->enqueue(add => [5, 5]);
+$id  = $minion->enqueue(add => [5, 5]);
 $job = $minion->job("$id");
 ok $job->remove, 'job has been removed';
 $worker->unregister;
 
 # Jobs with priority
 $minion->enqueue(add => [1, 2]);
-$id = $minion->enqueue(add => [2, 4], {priority => 1});
+$id  = $minion->enqueue(add => [2, 4], {priority => 1});
 $job = $worker->register->dequeue(0);
 is $job->id, $id, 'right id';
 is $job->info->{priority}, 1, 'right priority';
 ok $job->finish, 'job finished';
 isnt $worker->dequeue(0)->id, $id, 'different id';
-$id = $minion->enqueue(add => [2, 5]);
+$id  = $minion->enqueue(add => [2, 5]);
 $job = $worker->register->dequeue(0);
 is $job->id, $id, 'right id';
 is $job->info->{priority}, 0, 'right priority';
@@ -535,7 +594,7 @@
   }
 );
 $worker = $minion->worker->register;
-$id = $minion->enqueue(add => [3, 3]);
+$id     = $minion->enqueue(add => [3, 3]);
 is $enqueue, $id, 'enqueue event has been emitted';
 $minion->enqueue(add => [4, 3]);
 $job = $worker->dequeue(0);
@@ -592,7 +651,7 @@
 $worker->unregister;
 
 # Failed jobs
-$id = $minion->enqueue(add => [5, 6]);
+$id  = $minion->enqueue(add => [5, 6]);
 $job = $worker->register->dequeue(0);
 is $job->id, $id, 'right id';
 is $job->info->{result}, undef, 'no result';
@@ -600,7 +659,7 @@
 ok !$job->finish, 'job not finished';
 is $job->info->{state},  'failed',        'right state';
 is $job->info->{result}, 'Unknown error', 'right result';
-$id = $minion->enqueue(add => [6, 7]);
+$id  = $minion->enqueue(add => [6, 7]);
 $job = $worker->dequeue(0);
 is $job->id, $id, 'right id';
 ok $job->fail('Something bad happened!'), 'job failed';
@@ -667,7 +726,7 @@
 is $minion->backoff->(4),  271,    'right result';
 is $minion->backoff->(5),  640,    'right result';
 is $minion->backoff->(25), 390640, 'right result';
-$id = $minion->enqueue(exit => [] => {attempts => 2});
+$id  = $minion->enqueue(exit => [] => {attempts => 2});
 $job = $worker->register->dequeue(0);
 is $job->id, $id, 'right id';
 is $job->retries, 0, 'job has not been retried';
@@ -698,7 +757,7 @@
 $worker->unregister;
 
 # Multiple attempts during maintenance
-$id = $minion->enqueue(exit => [] => {attempts => 2});
+$id  = $minion->enqueue(exit => [] => {attempts => 2});
 $job = $worker->register->dequeue(0);
 is $job->id, $id, 'right id';
 is $job->retries, 0, 'job has not been retried';
@@ -831,11 +890,11 @@
 ok $job->finish, 'job finished';
 is $minion->stats->{finished_jobs}, 3, 'three finished jobs';
 is $minion->repair->stats->{finished_jobs}, 0, 'no finished jobs';
-$id = $minion->enqueue(test => [] => {parents => [-1]});
+$id  = $minion->enqueue(test => [] => {parents => [-1]});
 $job = $worker->dequeue(0);
 is $job->id, $id, 'right id';
 ok $job->finish, 'job finished';
-$id = $minion->enqueue(test => [] => {parents => [-1]});
+$id  = $minion->enqueue(test => [] => {parents => [-1]});
 $job = $worker->dequeue(0);
 is $job->id, $id, 'right id';
 is_deeply $job->info->{parents}, [-1], 'right parents';
@@ -912,6 +971,34 @@
 $_->unregister for $worker, $worker2;
 ok !$minion->broadcast('test_id', []), 'command not sent';
 
+# Single process worker
+$worker = $minion->repair->worker->register;
+$minion->add_task(
+  good_job => sub {
+    my ($job, $message) = @_;
+    $job->finish("$message Mojo!");
+  }
+);
+$minion->add_task(
+  bad_job => sub {
+    my ($job, $message) = @_;
+    die 'Bad job!';
+  }
+);
+$id  = $minion->enqueue('good_job', ['Hello']);
+$id2 = $minion->enqueue('bad_job',  ['Hello']);
+while (my $job = $worker->dequeue(0)) {
+  next unless my $err = $job->execute;
+  $job->fail("Error: $err");
+}
+$worker->unregister;
+$job = $minion->job($id);
+is $job->info->{state},  'finished',    'right state';
+is $job->info->{result}, 'Hello Mojo!', 'right result';
+$job2 = $minion->job($id2);
+is $job2->info->{state},    'failed',            'right state';
+like $job2->info->{result}, qr/Error: Bad job!/, 'right error';
+
 # Clean up once we are done
 $pg->db->query('drop schema minion_test cascade');
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Minion-9.07/t/pg_worker.t 
new/Minion-9.09/t/pg_worker.t
--- old/Minion-9.07/t/pg_worker.t       2018-09-21 02:33:25.000000000 +0200
+++ new/Minion-9.09/t/pg_worker.t       2019-02-02 03:02:31.000000000 +0100
@@ -43,7 +43,7 @@
     my $job     = shift;
     my $forever = 1;
     my $message = 'signals:';
-    local $SIG{INT} = sub { $forever = 0 };
+    local $SIG{INT}  = sub { $forever = 0 };
     local $SIG{USR1} = sub { $message .= ' usr1' };
     local $SIG{USR2} = sub { $message .= ' usr2' };
     $job->minion->broadcast('kill', [$_, $job->id]) for qw(USR1 USR2 INT);


Reply via email to