redis-consumer 1.1.6 → 1.1.8
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.
- package/dist/consumer.js +3 -11
- package/package.json +3 -3
package/dist/consumer.js
CHANGED
|
@@ -109,18 +109,10 @@ class RedisConsumer {
|
|
|
109
109
|
throw new Error("No state was found for stream processing of " + stream);
|
|
110
110
|
const fnc = state.executable;
|
|
111
111
|
const messages = streamMessages.messages;
|
|
112
|
-
let msgids;
|
|
113
112
|
for (const message of messages) {
|
|
114
113
|
try {
|
|
115
114
|
await fnc(message, stream);
|
|
116
|
-
|
|
117
|
-
msgids = [message.id];
|
|
118
|
-
const ackid = await this.originalClient.xAck(
|
|
119
|
-
stream,
|
|
120
|
-
this.originalClient.groupName,
|
|
121
|
-
msgids,
|
|
122
|
-
);
|
|
123
|
-
ackid && (await this.originalClient.xDel(stream, msgids));
|
|
115
|
+
this.addAckMessage(stream, message.id);
|
|
124
116
|
} catch (err) {
|
|
125
117
|
// console.error(err);
|
|
126
118
|
this.client.emit("process-error", err, { stream, message, retries: 0 });
|
|
@@ -133,7 +125,7 @@ class RedisConsumer {
|
|
|
133
125
|
}
|
|
134
126
|
}
|
|
135
127
|
}
|
|
136
|
-
|
|
128
|
+
await this.acknowlegdeMessages();
|
|
137
129
|
const recovering = state.recovering;
|
|
138
130
|
if (recovering && messages.length === 0) {
|
|
139
131
|
state.nextId = ">";
|
|
@@ -155,8 +147,8 @@ class RedisConsumer {
|
|
|
155
147
|
ackMessages,
|
|
156
148
|
);
|
|
157
149
|
if (id) {
|
|
158
|
-
this.successfullMessages.delete(stream);
|
|
159
150
|
await this.originalClient.xDel(stream, ackMessages);
|
|
151
|
+
this.successfullMessages.delete(stream);
|
|
160
152
|
}
|
|
161
153
|
}
|
|
162
154
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "redis-consumer",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8",
|
|
4
4
|
"description": "Simple NodeJs consumer and producer for Redis Streams",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
},
|
|
34
34
|
"homepage": "https://github.com/tomasky/redis-streams-nodejs#readme",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"redis": "^4.
|
|
36
|
+
"redis": "^4.7.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@types/node": "^
|
|
39
|
+
"@types/node": "^22.15.0",
|
|
40
40
|
"typescript": "latest"
|
|
41
41
|
}
|
|
42
42
|
}
|