Commit 20a523f0 authored by Jessica Severin's avatar Jessica Severin
Browse files

changed sql INSERT syntax to be compliant with postgreSQL

parent 33dd49ae
...@@ -131,8 +131,9 @@ sub create_new_worker { ...@@ -131,8 +131,9 @@ sub create_new_worker {
$pid = getppid unless($pid); $pid = getppid unless($pid);
$beekeeper = '' unless($beekeeper); $beekeeper = '' unless($beekeeper);
my $sql = "INSERT INTO hive SET born=now(), last_check_in=now(), " . my $sql = q{INSERT INTO hive
"process_id=?, analysis_id=?, beekeeper=?, host=?"; (born, last_check_in, process_id, analysis_id, beekeeper, host)
VALUES (NOW(), NOW(), ?,?,?,?)};
my $sth = $self->prepare($sql); my $sth = $self->prepare($sql);
$sth->execute($pid, $analysisStats->analysis_id, $beekeeper, $host); $sth->execute($pid, $analysisStats->analysis_id, $beekeeper, $host);
...@@ -434,7 +435,7 @@ sub get_num_needed_workers { ...@@ -434,7 +435,7 @@ sub get_num_needed_workers {
printf("%5d (%1.3f) ", $numWorkers, $availableLoad); printf("%5d (%1.3f) ", $numWorkers, $availableLoad);
$analysis_stats->print_stats(); $analysis_stats->print_stats();
} else { } else {
my $workerCount = POSIX::ceil($availableLoad * $analysis_stats->hive_capacity ); my $workerCount = POSIX::ceil($availableLoad * $analysis_stats->hive_capacity);
$numWorkers += $workerCount; $numWorkers += $workerCount;
$availableLoad -= $workerCount * (1/$analysis_stats->hive_capacity); $availableLoad -= $workerCount * (1/$analysis_stats->hive_capacity);
printf("%5d (%1.3f) use only %3d ", $numWorkers, $availableLoad, $workerCount); printf("%5d (%1.3f) use only %3d ", $numWorkers, $availableLoad, $workerCount);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment