blib/lib/App/Netdisco/Worker/Plugin/TastyJobs.pm untested

filter: Statementstmt 0.0% 0 / 31 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 6 Podpod n/a totaltotal 0.0% 0 / 40 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package App::Netdisco::Worker::Plugin::TastyJobs;
2  
3 use Dancer ':syntax';
4 use Dancer::Plugin::DBIC 'schema';
5  
6 use App::Netdisco::Worker::Plugin;
7 use aliased 'App::Netdisco::Worker::Status';
8  
9 use Data::Printer ();
10 use App::Netdisco::JobQueue 'jq_getsome';
11  
12 register_worker({ phase => 'main' }, sub {
13 my ($job, $workerconf) = @_;
14 my $num_slots = ($job->extra || 20);
15  
16 my $txn_guard = schema('netdisco')->storage->txn_scope_guard;
17 my @jobs = map { { %{ $_ } } } jq_getsome($num_slots);
18 undef $txn_guard;
19  
20 Data::Printer::p( @jobs );
21  
22 return Status->done("Showed the tastiest jobs");
23 });
24  
25 true;