afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
afuna ([personal profile] afuna) wrote in [site community profile] changelog2009-04-08 04:57 pm

[dw-free] DW::Worker::DistributeInvites will not work after a temporary failure

[commit: http://hg.dwscoalition.org/dw-free/rev/cc4ec07c2af5]

http://bugs.dwscoalition.org/show_bug.cgi?id=678

Don't delete job args

Patch by [personal profile] pauamma.

Files modified:
  • cgi-bin/DW/Worker/DistributeInvites.pm
--------------------------------------------------------------------------------
diff -r 17b2899a2fe2 -r cc4ec07c2af5 cgi-bin/DW/Worker/DistributeInvites.pm
--- a/cgi-bin/DW/Worker/DistributeInvites.pm	Wed Apr 08 16:52:15 2009 +0000
+++ b/cgi-bin/DW/Worker/DistributeInvites.pm	Wed Apr 08 16:57:27 2009 +0000
@@ -45,13 +45,13 @@ sub grab_for { 600 }
 
 sub work {
     my ($class, $job) = @_;
-    my $arg = $job->arg;
+    my %arg = %{$job->arg};
 
     my ($req_uid, $uckey, $ninv, $reason)
-        = map { delete $arg->{$_} } qw( requester searchclass invites reason );
+        = map { delete $arg{$_} } qw( requester searchclass invites reason );
 
-    return $job->permanent_failure( "Unknown keys: " . join( ", ", keys %$arg ))
-        if keys %$arg;
+    return $job->permanent_failure( "Unknown keys: " . join( ", ", keys %arg ))
+        if keys %arg;
     return $job->permanent_failure( "Missing argument" )
         unless defined $req_uid and defined $uckey
                and defined $ninv and defined $reason;
--------------------------------------------------------------------------------