Commit e83e0348 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Minor tweaks to stat records stuff.

parent 9d679d05
......@@ -2628,11 +2628,23 @@ sub UploadStats()
{
my @updates = ();
foreach my $key (keys(%expt_stats)) {
$val = $expt_stats{$key};
#
# Need the exptidx for the insert.
#
my $result =
DBQueryFatal("select idx from experiments ".
"where pid='$pid' and eid='$eid'");
push (@updates, "$key=$val");
my ($idx) = $result->fetchrow_array;
if (defined($idx) && $idx) {
foreach my $key (keys(%expt_stats)) {
$val = $expt_stats{$key};
push (@updates, "$key=$val");
}
DBQueryFatal("update experiment_stats ".
"set " . join(",", @updates) . " ".
"where pid='$pid' and eid='$eid' and idx=$idx");
}
DBQueryFatal("update experiment_stats set " . join(",", @updates) . " ".
"where pid='$pid' and eid='$eid'");
}
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