Jobrun

 view release on metacpan or  search on metacpan

lib/Jobrun.pm  view on Meta::CPAN

sub selectTable {
	my ( $self, $column, $value ) = @_;
	my $dbh = $self->{dbh};
	my $sth = $dbh->prepare("SELECT * FROM $controlTable WHERE ? = ?");
	$sth->execute( $column, $value );
	my $hashRef = $sth->fetchall_hashref;
	return $hashRef;
}

# only updates status and exit_code
sub updateStatus {
	my ( $self, $name, $status, $exit_code, $startTime, $endTime, $elapsedTime ) = @_;
	my $dbh = $self->{dbh};
	my $sth = $dbh->prepare("UPDATE $controlTable SET status = ?, exit_code = ?, start_time = ? , end_time = ?, elapsed_time = ?  WHERE name = ?");
	$sth->execute( $status, $exit_code, $startTime, $endTime, $elapsedTime, $name );

	#$dbh->commit();
	return;
}

# this is a sanity check for the child processes



( run in 0.259 second using v1.01-cache-2.11-cpan-beeb90c9504 )