@yaebal/runner 0.0.1 → 0.0.2
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/package.json +2 -2
- package/src/index.test.ts +1 -1
- package/src/index.ts +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yaebal/runner",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "yaebal runner — concurrent update processing with per-chat sequentialization.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"src"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@yaebal/types": "0.0.
|
|
19
|
+
"@yaebal/types": "0.0.2"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@types/node": "latest"
|
package/src/index.test.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -181,7 +181,7 @@ export function run(bot: RunnerBot, options: RunnerOptions = {}): RunnerHandle {
|
|
|
181
181
|
while (!stopped) {
|
|
182
182
|
if (scheduler.size() >= concurrency) await scheduler.whenBelow(concurrency);
|
|
183
183
|
if (stopped) break;
|
|
184
|
-
|
|
184
|
+
|
|
185
185
|
let updates: Update[];
|
|
186
186
|
try {
|
|
187
187
|
updates = await bot.api.getUpdates({
|
|
@@ -192,13 +192,13 @@ export function run(bot: RunnerBot, options: RunnerOptions = {}): RunnerHandle {
|
|
|
192
192
|
});
|
|
193
193
|
} catch (error) {
|
|
194
194
|
if (stopped) break;
|
|
195
|
-
|
|
195
|
+
|
|
196
196
|
options.onError?.(error);
|
|
197
197
|
await delay(3000);
|
|
198
|
-
|
|
198
|
+
|
|
199
199
|
continue;
|
|
200
200
|
}
|
|
201
|
-
|
|
201
|
+
|
|
202
202
|
for (const update of updates) {
|
|
203
203
|
offset = update.update_id + 1;
|
|
204
204
|
scheduler.submit(seqBy(update), () => safe(update));
|