MrGamoo/API/TaskCreate.pm untested

filter: Statementstmt 0.0% 0 / 26 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 37 CC 3 SCAR 17.5
CC
3
Cov
0%
handler
12.0
BEGIN
2.0
BEGIN
2.0
CRAP 5.8
1 # -*- perl -*-
2  
3 # Copyright (c) 2010 AdCopy
4 # Author: Jeff Weisberg
5 # Created: 2010-Jan-13 12:11 (EST)
6 # Function:
7 #
8 # $Id: TaskCreate.pm,v 1.3 2011/01/10 15:23:00 jaw Exp $
9  
10 package AC::MrGamoo::API::TaskCreate;
11 use AC::MrGamoo::Debug 'api_task';
12 use AC::MrGamoo::Config;
13 use AC::MrGamoo::Protocol;
14  
15 use AC::MrGamoo::API::Simple;
16  
17 use strict;
18  
19 sub handler {
20 my $class = shift;
21 my $io = shift;
22 my $proto = shift;
23 my $req = shift;
24 my $content = shift;
25  
26 debug("new task $req->{jobid}/$req->{taskid}");
27 my $x = AC::MrGamoo::Task->new( %$req );
28 my $r = $x ? $x->start() : undef;
29  
30 if( $r ){
31 reply( 200, 'OK', $io, $proto, $req );
32 }else{
33 reply( 500, 'Error', $io, $proto, $req );
34 }
35 }
36  
37 1;