refs #6264 perf: replace now with vnNew
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
0c2b2b25b7
commit
784f5bb7f9
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue