Composer: Leverage serverTimeOffset for inline bot request caching
This commit is contained in:
parent
be4e05b8ca
commit
70b2404566
@ -99,7 +99,7 @@ addReducer('loadTopInlineBots', (global) => {
|
||||
const { serverTimeOffset } = global;
|
||||
const { hash, lastRequestedAt } = global.topInlineBots;
|
||||
|
||||
if (lastRequestedAt && Date.now() + serverTimeOffset - lastRequestedAt < TOP_PEERS_REQUEST_COOLDOWN) {
|
||||
if (lastRequestedAt && Date.now() + serverTimeOffset * 1000 - lastRequestedAt < TOP_PEERS_REQUEST_COOLDOWN) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -119,7 +119,7 @@ addReducer('loadTopInlineBots', (global) => {
|
||||
...newGlobal.topInlineBots,
|
||||
hash: newHash,
|
||||
userIds: ids,
|
||||
lastRequestedAt: Date.now(),
|
||||
lastRequestedAt: Date.now() + serverTimeOffset * 1000,
|
||||
},
|
||||
};
|
||||
setGlobal(newGlobal);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user