refs #6264 perf: replace now with vnNew
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Javier Segarra 2023-11-07 23:23:02 +01:00
parent 0c2b2b25b7
commit 784f5bb7f9
1 changed files with 1 additions and 1 deletions

View File

@ -3,7 +3,7 @@ const tokenConfig = require('./token-config');
module.exports = async token => { module.exports = async token => {
const accessTokenConfig = await tokenConfig(); const accessTokenConfig = await tokenConfig();
const now = new Date(); const now = Date.vnNew();
const differenceMilliseconds = now - token.created; const differenceMilliseconds = now - token.created;
const differenceSeconds = Math.floor(differenceMilliseconds / 1000); const differenceSeconds = Math.floor(differenceMilliseconds / 1000);
return differenceSeconds > accessTokenConfig.renewPeriod - accessTokenConfig.courtesyTime; return differenceSeconds > accessTokenConfig.renewPeriod - accessTokenConfig.courtesyTime;