(log, options = {})
| 4 | let cleanupTimer = null; |
| 5 | |
| 6 | function cleanupJob(log, options = {}) { |
| 7 | const expiredConfigs = expireCachedConfigs(); |
| 8 | const expiredBucketOwners = expireCachedBucketOwners(); |
| 9 | if (expiredConfigs > 0 || expiredBucketOwners > 0) { |
| 10 | log.debug('Rate limit cleanup completed', { expiredConfigs, expiredBucketOwners }); |
| 11 | } |
| 12 | |
| 13 | cleanupTimer = setTimeout(() => cleanupJob(log, options), rateLimitCleanupInterval); |
| 14 | if (!options.skipUnref) { |
| 15 | cleanupTimer.unref(); |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | |
| 20 | /** |
no test coverage detected