@aichatwar/shared 1.0.105 → 1.0.106
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.
|
@@ -14,7 +14,7 @@ class Listener {
|
|
|
14
14
|
constructor(consumer) {
|
|
15
15
|
this.ackDeadline = 5 * 1000; // 5 seconds
|
|
16
16
|
this.retryCount = 0;
|
|
17
|
-
this.maxInitialRetries =
|
|
17
|
+
this.maxInitialRetries = 3; // Show detailed retry logs for first 3 attempts
|
|
18
18
|
this.maxRetryDelay = 60000; // Cap delay at 60 seconds
|
|
19
19
|
this.isListening = false; // Track if listener is active
|
|
20
20
|
this.crashHandlerSetup = false; // Track if crash handler has been set up
|
|
@@ -108,11 +108,11 @@ class Listener {
|
|
|
108
108
|
const delay = Math.min(5000 * Math.pow(2, Math.min(this.retryCount - 1, 6)), this.maxRetryDelay);
|
|
109
109
|
// Show detailed logs for first few attempts, then less frequently
|
|
110
110
|
if (this.retryCount <= this.maxInitialRetries) {
|
|
111
|
-
console.warn(`[${this.topic}] Topic partition error (attempt ${this.retryCount}/${this.maxInitialRetries}): ${error.message}. Retrying in ${delay}ms...`);
|
|
111
|
+
console.warn(`[${this.topic}] Topic partition error (attempt ${this.retryCount}/${this.maxInitialRetries}, will continue indefinitely): ${error.message}. Retrying in ${delay}ms...`);
|
|
112
112
|
}
|
|
113
113
|
else if (this.retryCount % 10 === 0) {
|
|
114
114
|
// Log every 10th retry after initial attempts to avoid log spam
|
|
115
|
-
console.warn(`[${this.topic}] Still retrying subscription (attempt ${this.retryCount}). Topic may not exist yet or has no data. Retrying in ${delay}ms...`);
|
|
115
|
+
console.warn(`[${this.topic}] Still retrying subscription (attempt ${this.retryCount}, retrying indefinitely). Topic may not exist yet or has no data. Retrying in ${delay}ms...`);
|
|
116
116
|
}
|
|
117
117
|
// Retry indefinitely with exponential backoff
|
|
118
118
|
// This allows the listener to connect once the topic becomes available
|