new env var
This commit is contained in:
@@ -28,7 +28,7 @@ const uptimeObject: Map<string, UptimeEntry[]> = loadUptimeObject();
|
|||||||
export{ uptimeObject as uptime };
|
export{ uptimeObject as uptime };
|
||||||
|
|
||||||
function loadUptimeObject(): Map<string, UptimeEntry[]>{
|
function loadUptimeObject(): Map<string, UptimeEntry[]>{
|
||||||
const filePath = path.join(__dirname, "..", "uptime.json");
|
const filePath = process.env.UPTIMEJSON||path.join(__dirname, "..", "uptime.json");
|
||||||
if(fs.existsSync(filePath)){
|
if(fs.existsSync(filePath)){
|
||||||
try{
|
try{
|
||||||
const data = JSON.parse(fs.readFileSync(filePath, "utf8"));
|
const data = JSON.parse(fs.readFileSync(filePath, "utf8"));
|
||||||
@@ -255,4 +255,4 @@ function setStatus(instance: string | Instance, status: boolean): void{
|
|||||||
calcStats(instance);
|
calcStats(instance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user