@haven-fi/solauto-sdk 1.0.268 → 1.0.270
Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transactionsManager.d.ts","sourceRoot":"","sources":["../../src/transactions/transactionsManager.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,kBAAkB,EAEnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAKzD,OAAO,EACL,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,kBAAkB,EAElB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,oBAAoB,EAAa,MAAM,YAAY,CAAC;AAO7D,qBAAa,wBAAyB,SAAQ,KAAK;gBACrC,OAAO,EAAE,MAAM;CAK5B;AAqCD,qBAAa,eAAe;IAMjB,OAAO,EAAE,CACd,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC;IACxC,IAAI,CAAC,EAAE,MAAM;IARtB,oBAAoB,EAAG,MAAM,EAAE,CAAC;IAChC,EAAE,CAAC,EAAE,kBAAkB,CAAC;IACjB,WAAW,EAAE,OAAO,CAAS;gBAG3B,OAAO,EAAE,CACd,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,EACxC,IAAI,CAAC,EAAE,MAAM,YAAA;IAGhB,UAAU;IAKV,OAAO,CAAC,UAAU,EAAE,MAAM;IAMhC,cAAc,IAAI,MAAM,EAAE;CAY3B;AAmFD,oBAAY,iBAAiB;IAC3B,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,MAAM,WAAW;CAClB;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,QAAQ,C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AAU;IAXpB,OAAO,CAAC,QAAQ,CAAkC;IAClD,OAAO,CAAC,gBAAgB,CAAa;IACrC,OAAO,CAAC,YAAY,CAAe;gBAGzB,SAAS,EAAE,aAAa,GAAG,oBAAoB,EAC/C,cAAc,CAAC,GAAE,CAAC,QAAQ,EAAE,0BAA0B,KAAK,IAAI,aAAA,EAC/D,MAAM,CAAC,EAAE,kBAAkB,YAAA,EAC3B,kBAAkB,GAAE,kBAA2C,EAC/D,aAAa,CAAC,EAAE,aAAa,YAAA,EAC7B,OAAO,GAAE,MAAU,EACnB,UAAU,GAAE,MAAY;YAQpB,uBAAuB;IAwCrC,OAAO,CAAC,YAAY;YA8CN,aAAa;IAoB3B,OAAO,CAAC,4BAA4B;IAUpC,OAAO,CAAC,mBAAmB;YAMb,SAAS;IAgBV,UAAU,CACrB,YAAY,EAAE,eAAe,EAAE,GAC9B,OAAO,CAAC,0BAA0B,CAAC;IA+DzB,IAAI,CACf,KAAK,EAAE,eAAe,EAAE,GACvB,OAAO,CAAC,0BAA0B,CAAC;YAgCxB,qBAAqB;YAgDrB,cAAc;YAmCd,eAAe;CAkD9B"}
|
@@ -311,7 +311,9 @@ class TransactionsManager {
|
|
311
311
|
}
|
312
312
|
async processTransactionSet(itemSets, currentIndex) {
|
313
313
|
let itemSet = itemSets[currentIndex];
|
314
|
+
let num = 0;
|
314
315
|
await (0, generalUtils_1.retryWithExponentialBackoff)(async (attemptNum, prevError) => {
|
316
|
+
num = attemptNum;
|
315
317
|
if (currentIndex > 0 || attemptNum > 0) {
|
316
318
|
itemSet = await this.refreshItemSet(itemSets, currentIndex, attemptNum);
|
317
319
|
}
|
@@ -327,7 +329,7 @@ class TransactionsManager {
|
|
327
329
|
}
|
328
330
|
}, this.retries, this.retryDelay, this.errorsToThrow).catch((e) => {
|
329
331
|
if (itemSet) {
|
330
|
-
this.updateStatus(itemSet.name(), TransactionStatus.Failed,
|
332
|
+
this.updateStatus(itemSet.name(), TransactionStatus.Failed, num);
|
331
333
|
}
|
332
334
|
throw e;
|
333
335
|
});
|
@@ -340,7 +342,7 @@ class TransactionsManager {
|
|
340
342
|
...itemSets.slice(currentIndex + 1).flatMap((set) => set.items),
|
341
343
|
]);
|
342
344
|
if (newItemSets.length > 1) {
|
343
|
-
itemSets.splice(currentIndex
|
345
|
+
itemSets.splice(currentIndex, itemSets.length - currentIndex, ...newItemSets);
|
344
346
|
// const startOfQueuedStatuses = this.statuses.findIndex(x => x.status === TransactionStatus.Queued);
|
345
347
|
// this.statuses.splice(
|
346
348
|
// startOfQueuedStatuses,
|
@@ -351,7 +353,7 @@ class TransactionsManager {
|
|
351
353
|
// status: TransactionStatus.Queued,
|
352
354
|
// }))
|
353
355
|
// );
|
354
|
-
this.updateStatusForSets(newItemSets
|
356
|
+
this.updateStatusForSets(newItemSets);
|
355
357
|
}
|
356
358
|
return newItemSets[0];
|
357
359
|
}
|
package/package.json
CHANGED
@@ -468,9 +468,12 @@ export class TransactionsManager {
|
|
468
468
|
currentIndex: number
|
469
469
|
) {
|
470
470
|
let itemSet: TransactionSet | undefined = itemSets[currentIndex];
|
471
|
+
let num = 0;
|
471
472
|
|
472
473
|
await retryWithExponentialBackoff(
|
473
474
|
async (attemptNum, prevError) => {
|
475
|
+
num = attemptNum;
|
476
|
+
|
474
477
|
if (currentIndex > 0 || attemptNum > 0) {
|
475
478
|
itemSet = await this.refreshItemSet(
|
476
479
|
itemSets,
|
@@ -502,11 +505,7 @@ export class TransactionsManager {
|
|
502
505
|
this.errorsToThrow
|
503
506
|
).catch((e) => {
|
504
507
|
if (itemSet) {
|
505
|
-
this.updateStatus(
|
506
|
-
itemSet.name(),
|
507
|
-
TransactionStatus.Failed,
|
508
|
-
this.retries
|
509
|
-
);
|
508
|
+
this.updateStatus(itemSet.name(), TransactionStatus.Failed, num);
|
510
509
|
}
|
511
510
|
throw e;
|
512
511
|
});
|
@@ -527,9 +526,9 @@ export class TransactionsManager {
|
|
527
526
|
|
528
527
|
if (newItemSets.length > 1) {
|
529
528
|
itemSets.splice(
|
530
|
-
currentIndex
|
531
|
-
itemSets.length - currentIndex
|
532
|
-
...newItemSets
|
529
|
+
currentIndex,
|
530
|
+
itemSets.length - currentIndex,
|
531
|
+
...newItemSets
|
533
532
|
);
|
534
533
|
// const startOfQueuedStatuses = this.statuses.findIndex(x => x.status === TransactionStatus.Queued);
|
535
534
|
// this.statuses.splice(
|
@@ -541,7 +540,7 @@ export class TransactionsManager {
|
|
541
540
|
// status: TransactionStatus.Queued,
|
542
541
|
// }))
|
543
542
|
// );
|
544
|
-
this.updateStatusForSets(newItemSets
|
543
|
+
this.updateStatusForSets(newItemSets);
|
545
544
|
}
|
546
545
|
|
547
546
|
return newItemSets[0];
|