-
-
Notifications
You must be signed in to change notification settings - Fork 174
Description
steam
this._jobs = new StdLib.DataStructures.TTLCache(1000 * 60 * 2); // job callbacks are cleaned up after 2 minutes
this._jobsGC = new StdLib.DataStructures.TTLCache(1000 * 60 * 2);
this._richPresenceLocalization = {};
this._incomingMessageQueue = [];
this._useMessageQueue = false; // we only use the message queue while we're processing a multi message
this._ttlCache = new StdLib.DataStructures.TTLCache(1000 * 60 * 5); // default 5 minutes
TTLCache stdlib
/**
-
Construct a new TTLCache.
-
@param {int} ttlMilliseconds - Default time to live in milliseconds for each entry
-
@param {int} [gcIntervalMilliseconds=300000] - Time between garbage collections (default 1 minute)
-
@constructor
*/
constructor(ttlMilliseconds: number, gcIntervalMilliseconds: number = 60000) {
this.#container = new Map<string, {value: T, expire: number}>();
this.#ttl = ttlMilliseconds;// Force a GC every minute
setInterval(() => this.#gc(), gcIntervalMilliseconds).unref();
}
Screenshots and Error Logs
When the class is finalized and removed from memory, some intervals remain active and are not properly cleared.