BUGFIX: time is correct
This commit is contained in:
10
tokens.js
10
tokens.js
@@ -22,7 +22,7 @@ async function TokenRenew() {
|
||||
await deleteToken(tokenID);
|
||||
shared.eventEmitter.emit("tokenRenewalEnd");
|
||||
} catch (error) {
|
||||
Log(`[${shared.now}] Errore nel rinnovo del token: ${error}`);
|
||||
Log(`[${shared.now()}] Errore nel rinnovo del token: ${error}`);
|
||||
}
|
||||
}, day - hour);
|
||||
}
|
||||
@@ -34,7 +34,7 @@ async function getUserID() {
|
||||
Authorization: `Token ${shared.getToken()}`,
|
||||
},
|
||||
});
|
||||
Log(`[${shared.now}] UserID: ${response.data.id}`);
|
||||
Log(`[${shared.now()}] UserID: ${response.data.id}`);
|
||||
return response.data.id;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ async function deleteToken(tokenID) {
|
||||
},
|
||||
}
|
||||
);
|
||||
Log(`[${shared.now}] Token con ID ${tokenID} cancellato con successo`);
|
||||
Log(`[${shared.now()}] Token con ID ${tokenID} cancellato con successo`);
|
||||
}
|
||||
|
||||
async function getCurrentTokenID() {
|
||||
@@ -64,7 +64,7 @@ async function getCurrentTokenID() {
|
||||
const token = response.data.find((t) => t.name === "Uptime Kuma");
|
||||
if (!token) throw new Error("Token 'Uptime Kuma' non trovato");
|
||||
|
||||
Log(`[${shared.now}] CurrentTokenID: ${token.id}`);
|
||||
Log(`[${shared.now()}] CurrentTokenID: ${token.id}`);
|
||||
return token.id;
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ async function getNewToken() {
|
||||
},
|
||||
}
|
||||
);
|
||||
Log(`[${shared.now}] Nuovo token creato: ${response.data.plain_token}`);
|
||||
Log(`[${shared.now()}] Nuovo token creato: ${response.data.plain_token}`);
|
||||
return response.data.plain_token;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user