mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-23 06:33:08 +02:00
upd: apply same changes to featured
This commit is contained in:
parent
61c66b3825
commit
d252dc3d93
1 changed files with 10 additions and 4 deletions
|
@ -35,10 +35,16 @@ export class FeaturedService {
|
||||||
`${name}:${currentWindow}`,
|
`${name}:${currentWindow}`,
|
||||||
score,
|
score,
|
||||||
element);
|
element);
|
||||||
redisTransaction.expire(
|
|
||||||
`${name}:${currentWindow}`,
|
const TTL = await this.redisClient.ttl(`${name}:${currentWindow}`);
|
||||||
(windowRange * 3) / 1000,
|
|
||||||
'NX'); // "NX -- Set expiry only when the key has no expiry" = 有効期限がないときだけ設定
|
if (TTL === -1) {
|
||||||
|
this.redisClient.expire(`${name}:${currentWindow}`,
|
||||||
|
(windowRange * 3) / 1000, // 1時間
|
||||||
|
//'NX', // "NX -- Set expiry only when the key has no expiry" = 有効期限がないときだけ設定
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
await redisTransaction.exec();
|
await redisTransaction.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue