|
|
|
@ -12,7 +12,6 @@ const Quota = require("./commands/quota");
|
|
|
|
|
const Util = require("./common-util");
|
|
|
|
|
|
|
|
|
|
module.exports.create = function (config) {
|
|
|
|
|
// mode can be FRESH (default), DEV, or PACKAGE
|
|
|
|
|
|
|
|
|
|
const Env = {
|
|
|
|
|
FRESH_KEY: '',
|
|
|
|
@ -93,23 +92,25 @@ module.exports.create = function (config) {
|
|
|
|
|
disableIntegratedTasks: config.disableIntegratedTasks || false,
|
|
|
|
|
disableIntegratedEviction: config.disableIntegratedEviction || false,
|
|
|
|
|
lastEviction: +new Date(),
|
|
|
|
|
knownActiveAccounts: 0,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
(function () {
|
|
|
|
|
// mode can be FRESH (default), DEV, or PACKAGE
|
|
|
|
|
if (process.env.PACKAGE) {
|
|
|
|
|
// `PACKAGE=1 node server` uses the version string from package.json as the cache string
|
|
|
|
|
console.log("PACKAGE MODE ENABLED");
|
|
|
|
|
//console.log("PACKAGE MODE ENABLED");
|
|
|
|
|
Env.FRESH_MODE = false;
|
|
|
|
|
Env.DEV_MODE = false;
|
|
|
|
|
} else if (process.env.DEV) {
|
|
|
|
|
// `DEV=1 node server` will use a random cache string on every page reload
|
|
|
|
|
console.log("DEV MODE ENABLED");
|
|
|
|
|
//console.log("DEV MODE ENABLED");
|
|
|
|
|
Env.FRESH_MODE = false;
|
|
|
|
|
Env.DEV_MODE = true;
|
|
|
|
|
} else {
|
|
|
|
|
// `FRESH=1 node server` will set a random cache string when the server is launched
|
|
|
|
|
// and use it for the process lifetime or until it is reset from the admin panel
|
|
|
|
|
console.log("FRESH MODE ENABLED");
|
|
|
|
|
//console.log("FRESH MODE ENABLED");
|
|
|
|
|
Env.FRESH_KEY = +new Date();
|
|
|
|
|
}
|
|
|
|
|
}());
|
|
|
|
|