Subject: | no SUBMIT_JOB_HIGH_BG implementation |
Hi,
Gearman::Util doesn't contains SUBMIT_JOB_HIGH_BG.
If Gearman::Client starts a high priority background job, it got a regular SUBMIT_JOB_BG mode instead of SUBMIT_JOB_HIGH_BG.
Two simply changes in Gearman::Util and Gearman::Task will solve the problem.
Patches are in attachment.
Regards,
palik
Subject: | gearman-task-submit_job_high_bg.patch |
From 5d21c7653ed3c99c46574f271220e76b84bc7ccc Mon Sep 17 00:00:00 2001
From: Alexei Pastuchov <alexei.pastuchov@telecolumbus.de>
Date: Fri, 28 Nov 2014 14:08:27 +0100
Subject: [PATCH] bugfix pack_submit_packet: set submit_job_high_bg on request
---
lib/Gearman/Task.pm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/Gearman/Task.pm b/lib/Gearman/Task.pm
index d95a13b..ba687e5 100644
--- a/lib/Gearman/Task.pm
+++ b/lib/Gearman/Task.pm
@@ -129,7 +129,9 @@ sub pack_submit_packet {
my $is_background = shift;
my $mode = $is_background ?
- "submit_job_bg" :
+ ($task->{high_priority} ?
+ "submit_job_high_bg" :
+ "submit_job_bg") :
($task->{high_priority} ?
"submit_job_high" :
"submit_job");
--
1.9.1
Subject: | gearman-util-submit_job_high_bg.patch |
From e8dd6f8082e1f45a3e00c16c75aea39da56f7af3 Mon Sep 17 00:00:00 2001
From: Alexei Pastuchov <alexei.pastuchov@telecolumbus.de>
Date: Fri, 28 Nov 2014 14:06:23 +0100
Subject: [PATCH] add submit_job_high_bg
---
lib/Gearman/Util.pm | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/Gearman/Util.pm b/lib/Gearman/Util.pm
index ef00f32..3102213 100644
--- a/lib/Gearman/Util.pm
+++ b/lib/Gearman/Util.pm
@@ -22,6 +22,7 @@ our %cmd = (
7 => [ 'I', "submit_job" ], # C->J FUNC[0]UNIQ[0]ARGS
21 => [ 'I', "submit_job_high" ], # C->J FUNC[0]UNIQ[0]ARGS
18 => [ 'I', "submit_job_bg" ], # C->J " " " " "
+ 32 => [ 'I', "submit_job_high_bg" ], # C->J FUNC[0]UNIQ[0]ARGS
8 => [ 'O', "job_created" ], # J->C HANDLE
9 => [ 'I', "grab_job" ], # W->J --
--
1.9.1