Commit 135e8da5 authored by Mike Hibler's avatar Mike Hibler
Browse files

Use new sitevar that controls how long we let a batch job be idle before

swapping.

This is primarily for the "queue an interactive job" form of batching,
but applies to all batch jobs at the moment.
parent 273b4d8b
......@@ -135,6 +135,17 @@ if (!defined($tempnsfile)) {
$idleswap = 0;
}
#
# Batch jobs get a shorter idle time
#
my $swaptime = $idleswaptime;
if (!$immediate && TBSiteVarExists("idle/batch_threshold")) {
my $batchidleswaptime = TBGetSiteVar("idle/batch_threshold");
if ($swaptime > $batchidleswaptime) {
$swaptime = $batchidleswaptime;
}
}
#
# Create an experiment record. The pid/eid has to be unique, so lock the
# table for the check/insert.
......@@ -163,7 +174,7 @@ if (! DBQueryWarn("INSERT INTO experiments ".
" idle_ignore) ".
"VALUES ('$eid', '$pid', '$gid', now(), '$expires', ".
"$description,'$dbuid', '$dbuid', 'new', $priority, ".
"$swappable, $idleswap, '$idleswaptime', $autoswap, ".
"$swappable, $idleswap, '$swaptime', $autoswap, ".
"'$autoswaptime', $idleignore)")) {
DBQueryWarn("unlock tables");
die("*** $0:\n".
......
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