Branch Coverage

blib/lib/cPanel/TaskQueue/Ctrl.pm
Criterion Covered Total %
branch 12 138 8.7


line true false branch
146 0 4 unless defined $args
147 1 3 unless 'HASH' eq ref $args
149 2 3 unless defined $$args{$arg} and length $$args{$arg}
153 0 3 unless exists $validate{$arg}
154 0 3 unless $validate{$arg}($$args{$arg})
158 0 1 if $$self{'sname'}
166 0 0 unless $cmd
167 0 0 unless exists $commands{$cmd}
175 14 1 if ($cmd and exists $commands{$cmd})
183 14 1 if ($cmd and exists $commands{$cmd})
191 0 0 exists $$self{'logger'} ? :
0 0 defined $$self{'serial'} ? :
207 0 0 unless exists $$self{'sdir'}
208 0 0 exists $$self{'logger'} ? :
0 0 defined $$self{'serial'} ? :
220 0 0 unless @cmds
226 0 0 unless (eval { do { print $fh 'Id: ', $queue->queue_task($cmdstring), "\n"; 1 } })
235 0 0 unless @tids
240 0 0 if $queue->unqueue_task($id)
242 0 0 unless (eval { do { ++$count if $queue->unqueue_task($id); 1 } })
252 0 0 unless defined $subcmd
255 0 0 if ($subcmd eq 'at') { }
0 0 elsif ($subcmd eq 'after') { }
265 0 0 unless @cmds
270 0 0 unless (eval { do { print $fh 'Id: ', $sched->schedule_task($cmdstring, $args), "\n"; 1 } })
277 0 0 unless @tids
282 0 0 if $sched->unschedule_task($id)
284 0 0 unless (eval { do { ++$count if $sched->unschedule_task($id); 1 } })
294 0 0 unless defined $match
296 0 0 if $match eq $_
304 0 0 unless (defined $match)
310 0 0 if ($subcmd eq 'task') { }
0 0 elsif ($subcmd eq 'command') { }
320 0 0 if (@t) { }
335 0 0 if (_any_is('verbose', @subcmds))
340 0 0 unless @subcmds
343 0 0 if (_any_is('active', @subcmds))
345 0 0 if (@{$$lists{'processing'};})
352 0 0 if (_any_is('deferred', @subcmds))
354 0 0 if (@{$$lists{'deferred'};})
362 0 0 if (_any_is('waiting', @subcmds))
364 0 0 if (@{$$lists{'waiting'};})
372 0 0 unless $sched
373 0 0 if (_any_is('scheduled', @subcmds))
376 0 0 if (@{$sched_tasks;})
390 0 0 if (defined $verbosity and $verbosity eq 'verbose') { }
406 0 0 if (not defined $module) { }
0 0 elsif (exists $$plugins{$module}) { }
432 0 0 $queue->is_paused ? :
434 0 0 if (defined $sched)
439 0 0 if defined $seconds
449 0 0 unless (exists $format{$fmt})
455 0 0 if $@
467 0 0 if ($new_serial ne $curr_serial)
470 0 0 unless open my $ifh, '<', $curr_state_file
471 0 0 unless open my $ofh, '>', $new_state_file
494 0 0 unless 'scheduled' eq $_
0 0 unless grep {'waiting' eq $_ unless 'scheduled' eq $_;} @args
496 0 0 if (_any_is('scheduled', @args))
498 0 0 if ($cnt) { }
499 0 0 if $verbose
502 0 0 if $verbose
505 0 0 if (_any_is('waiting', @args))
506 0 0 if ($queue->has_work_to_do) { }
508 0 0 if $verbose
511 0 0 if $verbose
515 0 0 unless (eval { do { if (_any_is('scheduled', @args)) { my $cnt = $sched->process_ready_tasks($queue); if ($cnt) { print $fh "$cnt scheduled tasks moved to queue.\n" if $verbose; } else { print $fh "No scheduled tasks ready to queue.\n" if $verbose; } ; } ; if (_any_is('waiting', @args)) { if ($queue->has_work_to_do) { $queue->process_next_task; print "Activated a queued task.\n" if $verbose; } else { print "No work to do at this time.\n" if $verbose; } ; } ; 1 } })
524 0 0 if defined $task->started
531 0 0 defined $task->started ? :