Commit 840d34cd authored by Jonathon Duerig's avatar Jonathon Duerig

Use the current date/time as the cache token in development environments instead of commit hash.

parent 5ed7b5c3
......@@ -357,10 +357,18 @@ class Instance
}
#
# Determine Commit Hash of Emulab Install
# Return Caching Token, either the latest commit hash
# or the current time for development trees.
#
function CommitHash() {
return mysql_fetch_array(DBQueryFatal("select value from version_info where name='commithash'"))[0];
function CacheToken() {
if (preg_match("/\/dev\//", $_SERVER["SCRIPT_NAME"]))
{
return date('Y-m-d-H:i:s');
}
else
{
return mysql_fetch_array(DBQueryFatal("select value from version_info where name='commithash'"))[0];
}
}
}
?>
......@@ -29,7 +29,7 @@ window.APT_OPTIONS.configObject = {
'filesize' : { exports: 'filesize' },
'contextmenu': { },
},
urlArgs: "version=" + APT_COMMIT_HASH
urlArgs: "version=" + APT_CACHE_TOKEN
};
window.APT_OPTIONS.initialize = function (sup)
......
......@@ -162,7 +162,7 @@ $PAGEHEADER_FUNCTION = function($thinheader = 0, $ignore1 = NULL,
<link rel='stylesheet' href='css/bootstrap.css'>
<link rel='stylesheet' href='css/quickvm.css'>
<link rel='stylesheet' href='css/$APTSTYLE'>";
echo "<script>APT_COMMIT_HASH='" . Instance::CommitHash() . "';</script>";
echo "<script>APT_CACHE_TOKEN='" . Instance::CacheToken() . "';</script>";
echo "<script src='js/common.js'></script>
<script src='https://www.emulab.net/emulab_sup.js'></script>
</head>
......
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