diff options
author | Dylan William Hardison <dylan@hardison.net> | 2018-04-01 16:46:28 +0200 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2018-04-01 16:46:28 +0200 |
commit | 2f8b999750cc700faf03c6aee1c53d1fc4df767f (patch) | |
tree | ef00bf6fd9932fd4fa1fc69e3108a1c5603aa64a /Bugzilla/JobQueue/Runner.pm | |
parent | c6d0d0e31a8b7b0e3c46ddf0a2be7741716d7977 (diff) | |
parent | 45485679f2e173170ed9c0e8a0eae979fe9de067 (diff) | |
download | bugzilla-2f8b999750cc700faf03c6aee1c53d1fc4df767f.tar.gz bugzilla-2f8b999750cc700faf03c6aee1c53d1fc4df767f.tar.xz |
Merge branch 'master' of git://github.com/mozilla-bteam/bmo
Diffstat (limited to 'Bugzilla/JobQueue/Runner.pm')
-rw-r--r-- | Bugzilla/JobQueue/Runner.pm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Bugzilla/JobQueue/Runner.pm b/Bugzilla/JobQueue/Runner.pm index 1c74bc28f..0177de40a 100644 --- a/Bugzilla/JobQueue/Runner.pm +++ b/Bugzilla/JobQueue/Runner.pm @@ -26,7 +26,7 @@ use Cwd qw(abs_path); use English qw(-no_match_vars $PROGRAM_NAME $EXECUTABLE_NAME); use File::Basename; use File::Copy; -use File::Spec::Functions qw(catfile); +use File::Spec::Functions qw(catfile tmpdir); use Future; use Future::Utils qw(fmap_void); use IO::Async::Loop; @@ -52,7 +52,7 @@ sub gd_preconfig { my $pidfile = $self->{gd_args}{pidfile}; if ( !$pidfile ) { - $pidfile = bz_locations()->{datadir} . '/' . $self->{gd_progname} . '.pid'; + $pidfile = catfile(tmpdir(), $self->{gd_progname} . '.pid'); } return ( pidfile => $pidfile ); } @@ -211,7 +211,7 @@ sub gd_run { my $self = shift; my $jobs = $self->{gd_args}{jobs} // 1; my $signal_f = $self->{_signal_future}; - my $workers_f = fmap_void { $self->run_worker("work") } + my $workers_f = fmap_void { $self->run_worker() } concurrent => $jobs, generate => sub { !$signal_f->is_ready }; @@ -225,10 +225,10 @@ sub gd_run { # This executes the script "jobqueue-worker.pl" # $EXECUTABLE_NAME is the name of the perl interpreter. sub run_worker { - my ( $self, $fn ) = @_; + my ( $self ) = @_; my $script = catfile( bz_locations->{cgi_path}, 'jobqueue-worker.pl' ); - my @command = ( $EXECUTABLE_NAME, $script, '--function' => $fn ); + my @command = ( $EXECUTABLE_NAME, $script); if ( $self->{gd_args}{progname} ) { push @command, '--name' => "$self->{gd_args}{progname} [worker]"; } |