Skip to content

Commit

Permalink
unref timeout instead of using SIGTERM event
Browse files Browse the repository at this point in the history
  • Loading branch information
0xturner committed Jan 15, 2025
1 parent 0e03983 commit 5b71bfd
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/RateLimiterPrisma.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ class RateLimiterPrisma extends RateLimiterStoreAbstract {
if (this.clearExpiredByTimeout) {
this._clearExpiredHourAgo();
}

process.on('SIGTERM', () => {
if (this._clearExpiredTimeoutId) {
clearTimeout(this._clearExpiredTimeoutId);
}
});
}

_getRateLimiterRes(rlKey, changedPoints, result) {
Expand Down Expand Up @@ -126,6 +120,7 @@ class RateLimiterPrisma extends RateLimiterStoreAbstract {
});
this._clearExpiredHourAgo();
}, 300000); // Clear every 5 minutes
this._clearExpiredTimeoutId.unref();
}
}

Expand Down

0 comments on commit 5b71bfd

Please sign in to comment.