BUGFIX: time is correct

This commit is contained in:
La Programmatrice Verde
2025-08-20 17:59:57 +02:00
parent f47ed4912a
commit db9e99cc52
5 changed files with 23 additions and 21 deletions

View File

@@ -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;
}