MCPcopy
hub / github.com/sindresorhus/p-queue / #initializeIntervalIfNeeded

Method #initializeIntervalIfNeeded

source/index.ts:340–358  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

338 }
339
340 #initializeIntervalIfNeeded(): void {
341 if (this.#isIntervalIgnored || this.#intervalId !== undefined) {
342 return;
343 }
344
345 // Strict mode uses timeouts instead of interval timers
346 if (this.#strict) {
347 return;
348 }
349
350 this.#intervalId = setInterval(
351 () => {
352 this.#onInterval();
353 },
354 this.#interval,
355 );
356
357 this.#intervalEnd = Date.now() + this.#interval;
358 }
359
360 #onInterval(): void {
361 // Non-strict mode uses interval timers and intervalCount

Callers 2

#onResumeIntervalMethod · 0.95
#tryToStartAnotherMethod · 0.95

Calls 1

#onIntervalMethod · 0.95

Tested by

no test coverage detected