MCPcopy
hub / github.com/vercel/hyper / queueForRetry

Method queueForRetry

bin/yarn-standalone.js:78325–78359  ·  view source on GitHub ↗

* Queue up request arguments to be retried. Start a network connectivity timer if there * isn't already one.

(opts)

Source from the content-addressed store, hash-verified

78323 */
78324
78325 queueForRetry(opts) {
78326 if (opts.retryReason) {
78327 let containsReason = false;
78328
78329 for (var _iterator = this.offlineQueue, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
78330 var _ref;
78331
78332 if (_isArray) {
78333 if (_i >= _iterator.length) break;
78334 _ref = _iterator[_i++];
78335 } else {
78336 _i = _iterator.next();
78337 if (_i.done) break;
78338 _ref = _i.value;
78339 }
78340
78341 const queuedOpts = _ref;
78342
78343 if (queuedOpts.retryReason === opts.retryReason) {
78344 containsReason = true;
78345 break;
78346 }
78347 }
78348
78349 if (!containsReason) {
78350 this.reporter.info(opts.retryReason);
78351 }
78352 }
78353
78354 if (!this.offlineQueue.length) {
78355 this.initOfflineRetry();
78356 }
78357
78358 this.offlineQueue.push(opts);
78359 }
78360
78361 /**
78362 * Begin timers to retry failed requests when we possibly establish network connectivity

Callers

nothing calls this directly

Calls 4

initOfflineRetryMethod · 0.95
nextMethod · 0.45
infoMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected