Skip to content

Commit

Permalink
fix download counter
Browse files Browse the repository at this point in the history
  • Loading branch information
mastercoms committed Aug 5, 2024
1 parent 9803554 commit 7d0021e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class HudDownloadCounter extends DurableObject {
const now = Date.now();
const last = knownIpBlocks[ip];
// TODO: add fractional download value over duration of cooldown?
if (now - last < HudDownloadCounter.milliseconds_per_request) {
if (last && now - last < HudDownloadCounter.milliseconds_per_request) {
return false;
}
knownIpBlocks[ip] = now;
Expand Down

0 comments on commit 7d0021e

Please sign in to comment.