Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package perl-Minion for openSUSE:Factory 
checked in at 2021-06-16 20:34:57
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Minion (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Minion.new.32437 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Minion"

Wed Jun 16 20:34:57 2021 rev:69 rq:900226 version:10.22

Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Minion/perl-Minion.changes  2021-03-24 
16:13:02.979945132 +0100
+++ /work/SRC/openSUSE:Factory/.perl-Minion.new.32437/perl-Minion.changes       
2021-06-16 20:36:48.323321319 +0200
@@ -1,0 +2,9 @@
+Fri Jun 11 03:07:12 UTC 2021 - Tina M??ller <[email protected]>
+
+- updated to 10.22
+   see /usr/share/doc/packages/perl-Minion/Changes
+
+  10.22  2021-06-10
+    - Add perform_jobs_in_foreground method to Minion.
+
+-------------------------------------------------------------------

Old:
----
  Minion-10.21.tar.gz

New:
----
  Minion-10.22.tar.gz

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

Other differences:
------------------
++++++ perl-Minion.spec ++++++
--- /var/tmp/diff_new_pack.Duwjq3/_old  2021-06-16 20:36:48.715321988 +0200
+++ /var/tmp/diff_new_pack.Duwjq3/_new  2021-06-16 20:36:48.715321988 +0200
@@ -18,7 +18,7 @@
 
 %define cpan_name Minion
 Name:           perl-Minion
-Version:        10.21
+Version:        10.22
 Release:        0
 Summary:        Job queue
 License:        Artistic-2.0

++++++ Minion-10.21.tar.gz -> Minion-10.22.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Minion-10.21/Changes new/Minion-10.22/Changes
--- old/Minion-10.21/Changes    2021-03-20 22:50:50.000000000 +0100
+++ new/Minion-10.22/Changes    2021-06-10 17:25:40.000000000 +0200
@@ -1,4 +1,7 @@
 
+10.22  2021-06-10
+  - Add perform_jobs_in_foreground method to Minion.
+
 10.21  2021-03-20
   - Fixed YAML::XS dependency.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Minion-10.21/MANIFEST.SKIP 
new/Minion-10.22/MANIFEST.SKIP
--- old/Minion-10.21/MANIFEST.SKIP      2020-05-13 21:52:49.000000000 +0200
+++ new/Minion-10.22/MANIFEST.SKIP      2021-03-25 21:11:47.000000000 +0100
@@ -6,3 +6,5 @@
 ^blib
 ^pm_to_blib
 \B\.DS_Store
+^node_modules
+^package-lock\.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Minion-10.21/META.json new/Minion-10.22/META.json
--- old/Minion-10.21/META.json  2021-03-20 22:51:40.000000000 +0100
+++ new/Minion-10.22/META.json  2021-06-10 18:02:21.000000000 +0200
@@ -4,7 +4,7 @@
       "Sebastian Riedel <[email protected]>"
    ],
    "dynamic_config" : 0,
-   "generated_by" : "ExtUtils::MakeMaker version 7.60, CPAN::Meta::Converter 
version 2.150010",
+   "generated_by" : "ExtUtils::MakeMaker version 7.62, CPAN::Meta::Converter 
version 2.150010",
    "license" : [
       "artistic_2"
    ],
@@ -54,10 +54,10 @@
          "web" : "https://github.com/mojolicious/minion";
       },
       "x_IRC" : {
-         "url" : "irc://chat.freenode.net/#mojo",
-         "web" : "https://webchat.freenode.net/#mojo";
+         "url" : "irc://irc.libera.chat/#mojo",
+         "web" : "https://web.libera.chat/#mojo";
       }
    },
-   "version" : "10.21",
+   "version" : "10.22",
    "x_serialization_backend" : "JSON::PP version 4.06"
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Minion-10.21/META.yml new/Minion-10.22/META.yml
--- old/Minion-10.21/META.yml   2021-03-20 22:51:40.000000000 +0100
+++ new/Minion-10.22/META.yml   2021-06-10 18:02:21.000000000 +0200
@@ -7,7 +7,7 @@
 configure_requires:
   ExtUtils::MakeMaker: '0'
 dynamic_config: 0
-generated_by: 'ExtUtils::MakeMaker version 7.60, CPAN::Meta::Converter version 
2.150010'
+generated_by: 'ExtUtils::MakeMaker version 7.62, CPAN::Meta::Converter version 
2.150010'
 license: artistic_2
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -24,11 +24,11 @@
   perl: '5.016'
 resources:
   IRC:
-    url: irc://chat.freenode.net/#mojo
-    web: https://webchat.freenode.net/#mojo
+    url: irc://irc.libera.chat/#mojo
+    web: https://web.libera.chat/#mojo
   bugtracker: https://github.com/mojolicious/minion/issues
   homepage: https://mojolicious.org
   license: http://www.opensource.org/licenses/artistic-license-2.0
   repository: https://github.com/mojolicious/minion.git
-version: '10.21'
+version: '10.22'
 x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Minion-10.21/Makefile.PL new/Minion-10.22/Makefile.PL
--- old/Minion-10.21/Makefile.PL        2021-03-18 11:48:39.000000000 +0100
+++ new/Minion-10.22/Makefile.PL        2021-06-10 17:25:40.000000000 +0200
@@ -25,7 +25,7 @@
         url  => 'https://github.com/mojolicious/minion.git',
         web  => 'https://github.com/mojolicious/minion',
       },
-      x_IRC => {url => 'irc://chat.freenode.net/#mojo', web => 
'https://webchat.freenode.net/#mojo'}
+      x_IRC => {url => 'irc://irc.libera.chat/#mojo', web => 
'https://web.libera.chat/#mojo'}
     },
   },
   PREREQ_PM => {Mojolicious => '9.0', 'YAML::XS' => '0.67'},
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Minion-10.21/README.md new/Minion-10.22/README.md
--- old/Minion-10.21/README.md  2021-03-14 16:16:27.000000000 +0100
+++ new/Minion-10.22/README.md  2021-04-24 02:00:14.000000000 +0200
@@ -1,7 +1,7 @@
 
 # Minion 
[![](https://github.com/mojolicious/minion/workflows/linux/badge.svg)](https://github.com/mojolicious/minion/actions)
 
-![Screenshot](https://raw.github.com/mojolicious/minion/master/examples/admin.png?raw=true)
+![Screenshot](https://raw.github.com/mojolicious/minion/main/examples/admin.png?raw=true)
 
   A high performance job queue for the Perl programming language, with support 
for multiple named queues, priorities,
   high priority fast lane, delayed jobs, job dependencies, job progress, job 
results, retries with backoff, rate
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Minion-10.21/lib/Minion/Guide.pod 
new/Minion-10.22/lib/Minion/Guide.pod
--- old/Minion-10.21/lib/Minion/Guide.pod       2021-03-20 22:50:34.000000000 
+0100
+++ new/Minion-10.22/lib/Minion/Guide.pod       2021-06-10 17:25:40.000000000 
+0200
@@ -347,7 +347,7 @@
 =head1 SUPPORT
 
 If you have any questions the documentation might not yet answer, don't 
hesitate to ask in the
-L<Forum|https://forum.mojolicious.org> or the official IRC channel C<#mojo> on 
C<chat.freenode.net>
-(L<chat now!|https://webchat.freenode.net/#mojo>).
+L<Forum|https://forum.mojolicious.org> or the official IRC channel C<#mojo> on 
C<irc.libera.chat>
+(L<chat now!|https://web.libera.chat/#mojo>).
 
 =cut
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Minion-10.21/lib/Minion.pm 
new/Minion-10.22/lib/Minion.pm
--- old/Minion-10.21/lib/Minion.pm      2021-03-14 21:47:53.000000000 +0100
+++ new/Minion-10.22/lib/Minion.pm      2021-06-10 17:44:35.000000000 +0200
@@ -21,7 +21,7 @@
 has [qw(remove_after stuck_after)] => 172800;
 has tasks                          => sub { {} };
 
-our $VERSION = '10.21';
+our $VERSION = '10.22';
 
 sub add_task {
   my ($self, $name, $task) = @_;
@@ -103,12 +103,8 @@
   return $self->backend($class->new(@_)->minion($self));
 }
 
-sub perform_jobs {
-  my ($self, $options) = @_;
-  my $worker = $self->worker;
-  while (my $job = $worker->register->dequeue(0, $options)) { $job->perform }
-  $worker->unregister;
-}
+sub perform_jobs               { _perform_jobs(0, @_) }
+sub perform_jobs_in_foreground { _perform_jobs(1, @_) }
 
 sub repair { shift->_delegate('repair') }
 
@@ -167,6 +163,18 @@
 
 sub _info { shift->backend->list_jobs(0, 1, {ids => [shift]})->{jobs}[0] }
 
+sub _perform_jobs {
+  my ($foreground, $minion, $options) = @_;
+
+  my $worker = $minion->worker;
+  while (my $job = $worker->register->dequeue(0, $options)) {
+    if    (!$foreground)                     { $job->perform }
+    elsif (defined(my $err = $job->execute)) { $job->fail($err) }
+    else                                     { $job->finish }
+  }
+  $worker->unregister;
+}
+
 sub _result {
   my ($self, $promise, $id) = @_;
   return $promise->resolve unless my $job = $self->_info($id);
@@ -213,8 +221,7 @@
 =begin html
 
 <p>
-  <img alt="Screenshot" 
src="https://raw.github.com/mojolicious/minion/master/examples/admin.png?raw=true";
    
-    width="600px">
+  <img alt="Screenshot" 
src="https://raw.github.com/mojolicious/minion/main/examples/admin.png?raw=true";
 width="600px">
 </p>
 
 =end html
@@ -234,7 +241,7 @@
 =head1 EXAMPLES
 
 This distribution also contains a great example application you can use for 
inspiration. The L<link
-checker|https://github.com/mojolicious/minion/tree/master/examples/linkcheck> 
will show you how to integrate background
+checker|https://github.com/mojolicious/minion/tree/main/examples/linkcheck> 
will show you how to integrate background
 jobs into well-structured L<Mojolicious> applications.
 
 =head1 EVENTS
@@ -808,6 +815,13 @@
 
 =back
 
+=head2 perform_jobs_in_foreground
+
+  $minion->perform_jobs_in_foreground;
+  $minion->perform_jobs_in_foreground({queues => ['important']});
+
+Same as L</"perform_jobs">, but all jobs are performed in the current process, 
without spawning new processes.
+
 =head2 result_p
 
   my $promise = $minion->result_p($id);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/Minion-10.21/lib/Mojolicious/Plugin/Minion/resources/public/minion/app.js 
new/Minion-10.22/lib/Mojolicious/Plugin/Minion/resources/public/minion/app.js
--- 
old/Minion-10.21/lib/Mojolicious/Plugin/Minion/resources/public/minion/app.js   
    2020-05-13 21:52:49.000000000 +0200
+++ 
new/Minion-10.22/lib/Mojolicious/Plugin/Minion/resources/public/minion/app.js   
    2021-03-26 01:34:37.000000000 +0100
@@ -1,27 +1,27 @@
 
-function checkAll() {
+function checkAll () {
   $('.checkall').click(function () {
-    var name  = $(this).data('check');
-    var input = $('input[type=checkbox][name=' + name + ']');
+    const name = $(this).data('check');
+    const input = $('input[type=checkbox][name=' + name + ']');
     input.prop('checked', $(this).prop('checked'));
   });
 }
 
-function humanTime() {
+function humanTime () {
   $('.from-now').each(function () {
-    var date = $(this);
+    const date = $(this);
     date.text(moment(date.text() * 1000).fromNow());
   });
   $('.duration').each(function () {
-    var date = $(this);
+    const date = $(this);
     console.log(date.text() * 1000);
     date.text(moment.duration(date.text() * 1000).humanize());
   });
- }
+}
 
-function pageStats(data) {}
+function pageStats (data) {}
 
-function pollStats(url) {
+function pollStats (url) {
   $.get(url).done(function (data) {
     $('.minion-stats-active-jobs').html(data.active_jobs);
     $('.minion-stats-active-locks').html(data.active_locks);
@@ -30,6 +30,6 @@
     $('.minion-stats-inactive-jobs').html(data.inactive_jobs);
     $('.minion-stats-workers').html(data.active_workers + 
data.inactive_workers);
     pageStats(data);
-    setTimeout(function () { pollStats(url) }, 3000);
-  }).fail(function () { setTimeout(function () { pollStats(url) }, 3000) });
+    setTimeout(() => { pollStats(url); }, 3000);
+  }).fail(() => { setTimeout(() => { pollStats(url); }, 3000); });
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/Minion-10.21/lib/Mojolicious/Plugin/Minion/resources/templates/layouts/minion.html.ep
 
new/Minion-10.22/lib/Mojolicious/Plugin/Minion/resources/templates/layouts/minion.html.ep
--- 
old/Minion-10.21/lib/Mojolicious/Plugin/Minion/resources/templates/layouts/minion.html.ep
   2021-03-18 20:21:46.000000000 +0100
+++ 
new/Minion-10.22/lib/Mojolicious/Plugin/Minion/resources/templates/layouts/minion.html.ep
   2021-03-26 01:35:00.000000000 +0100
@@ -14,7 +14,7 @@
     %= stylesheet '/minion/app.css'
     %= javascript '/minion/app.js'
     <script>
-      $(function () {
+      $(() => {
         checkAll();
         humanTime();
         pollStats('<%= url_for "minion_stats" %>');
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/Minion-10.21/lib/Mojolicious/Plugin/Minion/resources/templates/minion/dashboard.html.ep
 
new/Minion-10.22/lib/Mojolicious/Plugin/Minion/resources/templates/minion/dashboard.html.ep
--- 
old/Minion-10.21/lib/Mojolicious/Plugin/Minion/resources/templates/minion/dashboard.html.ep
 2020-07-08 04:01:31.000000000 +0200
+++ 
new/Minion-10.22/lib/Mojolicious/Plugin/Minion/resources/templates/minion/dashboard.html.ep
 2021-03-26 01:35:46.000000000 +0100
@@ -2,13 +2,13 @@
 
 % content_for head => begin
   <script>
-    var chart;
-    var historychart;
-    var backlog = 0;
+    let chart;
+    let historychart;
+    let backlog = 0;
     function pageStats(data) {
       $('.minion-stats-uptime').text(Math.round(data.uptime / 86400));
       $('.minion-stats-delayed-jobs').text(data.delayed_jobs);
-      var proc = data.enqueued_jobs - (data.inactive_jobs + data.active_jobs);
+      const proc = data.enqueued_jobs - (data.inactive_jobs + 
data.active_jobs);
       $('.minion-stats-processed-jobs').text(proc);
       backlog = data.active_jobs + (data.inactive_jobs - data.delayed_jobs);
     }
@@ -19,9 +19,7 @@
           axes: ['bottom', 'left'],
           windowSize: 120,
           historySize: 0,
-          tickFormats: {
-            bottom: function (d) { return moment(d).format('HH:mm') }
-          },
+          tickFormats: { bottom: d => moment(d).format('HH:mm') },
           data: [{
             label: 'Inactive Jobs',
             values: [{time: new Date().getTime(), y: backlog}]
@@ -35,8 +33,8 @@
     }
     function updateHistoryChart() {
       $.get('<%= url_for 'minion_history' %>').done(function (data) {
-        var hour;
-        var historylog = [];
+        let hour;
+        let historylog = [];
         for (hour = 0; hour < data.daily.length; hour++) { 
           historylog.push({
             x: new Date(data.daily[hour].epoch * 1000).getTime(),
@@ -47,7 +45,7 @@
           historychart = $('#history-chart').epoch({
             type: 'bar',
             tickFormats: {
-              bottom: function (d) { return moment(d).format('HH:00') }
+              bottom: d => moment(d).format('HH:00')
             },
             data: [{
               label: 'processed',
@@ -55,11 +53,11 @@
             }]
           });
         }
-        else { historychart.update([{label: 'processed', values: historylog}]) 
}
+        else { historychart.update([{ label: 'processed', values: historylog 
}]) }
         setTimeout(updateHistoryChart, 1000 * 60 * 10);
-      }).fail(function () { setTimeout(updateHistoryChart, 1000 * 60) });
+      }).fail(() => { setTimeout(updateHistoryChart, 1000 * 60) })
     }
-    $(function () {
+    $(() => {
       updateBacklogChart();
       updateHistoryChart();
     });
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Minion-10.21/t/pg.t new/Minion-10.22/t/pg.t
--- old/Minion-10.21/t/pg.t     2021-03-06 02:57:37.000000000 +0100
+++ new/Minion-10.22/t/pg.t     2021-06-10 17:48:33.000000000 +0200
@@ -1326,6 +1326,40 @@
   $worker->unregister;
 };
 
+subtest 'perform_jobs/perform_jobs_in_foreground' => sub {
+  $minion->add_task(
+    record_pid => sub {
+      my $job = shift;
+      $job->finish({pid => $$});
+    }
+  );
+  $minion->add_task(perform_fails => sub { die 'Just a test' });
+
+  my $id = $minion->enqueue('record_pid');
+  $minion->perform_jobs;
+  my $job = $minion->job($id);
+  is $job->task, 'record_pid', 'right task';
+  is $job->info->{state}, 'finished', 'right state';
+  isnt $job->info->{result}{pid}, $$, 'different process id';
+
+  my $id2 = $minion->enqueue('record_pid');
+  my $id3 = $minion->enqueue('perform_fails');
+  my $id4 = $minion->enqueue('record_pid');
+  $minion->perform_jobs_in_foreground;
+  my $job2 = $minion->job($id2);
+  is $job2->task, 'record_pid', 'right task';
+  is $job2->info->{state}, 'finished', 'right state';
+  is $job2->info->{result}{pid}, $$, 'same process id';
+  my $job3 = $minion->job($id3);
+  is $job3->task, 'perform_fails', 'right task';
+  is $job3->info->{state},    'failed',        'right state';
+  like $job3->info->{result}, qr/Just a test/, 'right error';
+  my $job4 = $minion->job($id4);
+  is $job4->task, 'record_pid', 'right task';
+  is $job4->info->{state}, 'finished', 'right state';
+  is $job4->info->{result}{pid}, $$, 'same process id';
+};
+
 subtest 'Foreground' => sub {
   my $id  = $minion->enqueue(test => [] => {attempts => 2});
   my $id2 = $minion->enqueue('test');
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Minion-10.21/t/pg_lite_app.t 
new/Minion-10.22/t/pg_lite_app.t
--- old/Minion-10.21/t/pg_lite_app.t    2021-01-29 18:05:38.000000000 +0100
+++ new/Minion-10.22/t/pg_lite_app.t    2021-06-10 17:25:40.000000000 +0200
@@ -48,7 +48,7 @@
 
 subtest 'Perform jobs automatically' => sub {
   $t->get_ok('/add' => form => {first => 1, second => 2})->status_is(200);
-  $t->app->minion->perform_jobs({queues => ['test']});
+  $t->app->minion->perform_jobs_in_foreground({queues => ['test']});
   $t->get_ok('/result' => form => {id    => 
$t->tx->res->text})->status_is(200)->content_is('3');
   $t->get_ok('/add'    => form => {first => 2, second => 3})->status_is(200);
   my $first = $t->tx->res->text;

Reply via email to