Hello all,

I am having a problem that I don't understand. I've got the following 
minion task in a helper in a plugin:

  $app->minion->add_task( passtest => sub {                                 
                                                    
                            my ( $job, $aa, $bb ) = @_;                     
                                                    
                            my $cc = "$aa $bb";                             
                                                    
                            $job->note( cc => "$cc" );                     
                                                     
                            $job->finish("All went well!, $cc");           
                                                     
                          } );


I call it from the controller thus:
Saisissez le code i  my $id2 = $c->minion->enqueue( passtest => [ "bla", 
"url" ] );                                                                
  my $job = $c->minion->job("$id2");                                       
                                                     
  say "New Method : " . pp($job->info);

But the output shows :


New Method : {
  args     => ["bla", "url"],
  attempts => 1,
  children => [],
  created  => 1571654552.89089,
  delayed  => 1571654552.89089,
  finished => undef,
  id       => 195520,
  notes    => {},
  parents  => [],
  priority => 0,
  queue    => "default",
  result   => undef,
  retried  => undef,
  retries  => 0,
  started  => undef,
  state    => "inactive",
  task     => "passtest",
  time     => 1571654552.89342,
  worker   => undef,
}

No data has been caught. The strange thing is that from the minion admin I 
can see the data:
Saisissez le code ici...{
  "args" => [
    "bla",
    "url"
  ],
  "attempts" => 1,
  "children" => [],
  "created" => "2019-10-21T10:42:32.89089Z",
  "delayed" => "2019-10-21T10:42:32.89089Z",
  "finished" => "2019-10-21T10:42:32.90722Z",
  "id" => 195520,
  "notes" => {
    "cc" => "bla url"
  },
  "parents" => [],
  "priority" => 0,
  "queue" => "default",
  "result" => "All went well!, bla url",
  "retried" => undef,
  "retries" => 0,
  "started" => "2019-10-21T10:42:32.89251Z",
  "state" => "finished",
  "task" => "passtest",
  "time" => "2019-10-21T10:45:09.66926Z",
  "worker" => 134
}

This is the point when I decide to ask for help. I've tried to pass hash 
referenced to the minion task as well, but they were not changed outside of 
the scope of the task, unlike in a subroutine. What should I be reading up 
on to better understand what is going on in such cases?

Kind regards,

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/664ae593-b7e2-416a-8780-9d1416322da5%40googlegroups.com.

Reply via email to