@zeeshan60/event-processor 1.0.21 → 1.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -52,7 +52,7 @@ class FriendEventHandler extends BaseEventHandler_1.BaseEventHandler {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
async handleFriendCreated(event, context) {
|
|
55
|
-
const maxRetries =
|
|
55
|
+
const maxRetries = 6;
|
|
56
56
|
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
|
57
57
|
try {
|
|
58
58
|
return await this._handleFriendCreatedWithRetryCheck(event, context, attempt);
|
|
@@ -88,7 +88,7 @@ class FriendEventHandler extends BaseEventHandler_1.BaseEventHandler {
|
|
|
88
88
|
shouldRetry: true,
|
|
89
89
|
delayMs: retryCheck.delayMs,
|
|
90
90
|
versionGap: retryCheck.versionGap,
|
|
91
|
-
maxRetries:
|
|
91
|
+
maxRetries: 6,
|
|
92
92
|
currentAttempt: attempt,
|
|
93
93
|
context,
|
|
94
94
|
logContext: {
|
|
@@ -110,7 +110,7 @@ class FriendEventHandler extends BaseEventHandler_1.BaseEventHandler {
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
async handleGenericFriendEvent(event, context) {
|
|
113
|
-
const maxRetries =
|
|
113
|
+
const maxRetries = 6;
|
|
114
114
|
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
|
115
115
|
try {
|
|
116
116
|
return await this._handleGenericFriendEventWithRetryCheck(event, context, attempt);
|
|
@@ -146,7 +146,7 @@ class FriendEventHandler extends BaseEventHandler_1.BaseEventHandler {
|
|
|
146
146
|
shouldRetry: true,
|
|
147
147
|
delayMs: retryCheck.delayMs,
|
|
148
148
|
versionGap: retryCheck.versionGap,
|
|
149
|
-
maxRetries:
|
|
149
|
+
maxRetries: 6,
|
|
150
150
|
currentAttempt: attempt,
|
|
151
151
|
context,
|
|
152
152
|
logContext: {
|
|
@@ -42,7 +42,7 @@ class TransactionEventHandler extends BaseEventHandler_1.BaseEventHandler {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
async handleEvent(event, context) {
|
|
45
|
-
const maxRetries =
|
|
45
|
+
const maxRetries = 6;
|
|
46
46
|
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
|
47
47
|
try {
|
|
48
48
|
return await this._handleEventWithRetryCheck(event, context, attempt);
|
|
@@ -96,7 +96,7 @@ class TransactionEventHandler extends BaseEventHandler_1.BaseEventHandler {
|
|
|
96
96
|
shouldRetry: true,
|
|
97
97
|
delayMs: retryCheck.delayMs,
|
|
98
98
|
versionGap: retryCheck.versionGap,
|
|
99
|
-
maxRetries:
|
|
99
|
+
maxRetries: 6,
|
|
100
100
|
currentAttempt: attempt,
|
|
101
101
|
context,
|
|
102
102
|
logContext: logData,
|
package/dist/UserEventHandler.js
CHANGED
|
@@ -46,7 +46,7 @@ class UserEventHandler extends BaseEventHandler_1.BaseEventHandler {
|
|
|
46
46
|
return await this.handleUserCreatedBackend(event);
|
|
47
47
|
}
|
|
48
48
|
else {
|
|
49
|
-
const maxRetries =
|
|
49
|
+
const maxRetries = 6;
|
|
50
50
|
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
|
51
51
|
try {
|
|
52
52
|
return await this._handleEventWithRetryCheck(event, context, attempt);
|
|
@@ -83,7 +83,7 @@ class UserEventHandler extends BaseEventHandler_1.BaseEventHandler {
|
|
|
83
83
|
shouldRetry: true,
|
|
84
84
|
delayMs: retryCheck.delayMs,
|
|
85
85
|
versionGap: retryCheck.versionGap,
|
|
86
|
-
maxRetries:
|
|
86
|
+
maxRetries: 6,
|
|
87
87
|
currentAttempt: attempt,
|
|
88
88
|
context,
|
|
89
89
|
logContext: {
|
package/dist/utils/tryLater.js
CHANGED
|
@@ -12,7 +12,7 @@ async function tryLater(options) {
|
|
|
12
12
|
if (options.currentAttempt >= options.maxRetries) {
|
|
13
13
|
throw new Error(`Max retries (${options.maxRetries}) exhausted for version gap of ${options.versionGap}`);
|
|
14
14
|
}
|
|
15
|
-
const delayMs = options.currentAttempt === 1 ? options.delayMs :
|
|
15
|
+
const delayMs = options.currentAttempt === 1 ? options.delayMs : 1000;
|
|
16
16
|
options.context?.logger?.info("[tryLater] Retrying after adaptive delay", {
|
|
17
17
|
...options.logContext,
|
|
18
18
|
requestId: options.context?.requestId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tryLater.js","sourceRoot":"","sources":["../../src/utils/tryLater.ts"],"names":[],"mappings":";;AAiBA,4BA6BC;AA9CD,qDAAkD;AAGlD,SAAS,KAAK,CAAC,EAAU;IACrB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC7D,CAAC;AAYM,KAAK,UAAU,QAAQ,CAAC,OAAwB;IACnD,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QACvB,OAAO;IACX,CAAC;IAED,IAAI,OAAO,CAAC,cAAc,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;QAC/C,MAAM,IAAI,KAAK,CACX,gBAAgB,OAAO,CAAC,UAAU,kCAAkC,OAAO,CAAC,UAAU,EAAE,CAC3F,CAAC;IACN,CAAC;IAED,MAAM,OAAO,GACT,OAAO,CAAC,cAAc,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"tryLater.js","sourceRoot":"","sources":["../../src/utils/tryLater.ts"],"names":[],"mappings":";;AAiBA,4BA6BC;AA9CD,qDAAkD;AAGlD,SAAS,KAAK,CAAC,EAAU;IACrB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC7D,CAAC;AAYM,KAAK,UAAU,QAAQ,CAAC,OAAwB;IACnD,IAAI,CAAC,OAAO,CA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