MCPcopy
hub / github.com/Kong/insomnia / shift

Method shift

packages/insomnia/bin/yarn-standalone.js:35542–35593  ·  view source on GitHub ↗
(key)

Source from the content-addressed store, hash-verified

35540 }
35541
35542 shift(key) {
35543 if (this.running[key]) {
35544 delete this.running[key];
35545 this.runningCount--;
35546
35547 if (this.stuckTimer) {
35548 clearTimeout(this.stuckTimer);
35549 this.stuckTimer = null;
35550 }
35551
35552 if (this.warnedStuck) {
35553 this.warnedStuck = false;
35554 debug(`${JSON.stringify(this.alias)} blocking queue finally resolved. Nothing to worry about.`);
35555 }
35556 }
35557
35558 const queue = this.queue[key];
35559 if (!queue) {
35560 return;
35561 }
35562
35563 var _queue$shift = queue.shift();
35564
35565 const resolve = _queue$shift.resolve,
35566 reject = _queue$shift.reject,
35567 factory = _queue$shift.factory;
35568
35569 if (!queue.length) {
35570 delete this.queue[key];
35571 }
35572
35573 const next = () => {
35574 this.shift(key);
35575 this.shiftConcurrencyQueue();
35576 };
35577
35578 const run = () => {
35579 this.running[key] = true;
35580 this.runningCount++;
35581
35582 factory().then(function (val) {
35583 resolve(val);
35584 next();
35585 return null;
35586 }).catch(function (err) {
35587 reject(err);
35588 next();
35589 });
35590 };
35591
35592 this.maybePushConcurrencyQueue(run);
35593 }
35594
35595 maybePushConcurrencyQueue(run) {
35596 if (this.runningCount < this.maxConcurrency) {

Callers 15

pushMethod · 0.95
nextMethod · 0.95
convertToPostmanFunction · 0.80
registerElectronHandlersFunction · 0.80
unlockFunction · 0.80
filesStatusMethod · 0.80
diffMethod · 0.80
settleFunction · 0.80
normalizePatternFunction · 0.80
nextFunction · 0.80
yarn-standalone.jsFile · 0.80
createIntegrityFunction · 0.80

Calls 3

stringifyMethod · 0.80
debugFunction · 0.70

Tested by

no test coverage detected