diff options
author | Volpeon <git@volpeon.ink> | 2021-10-19 20:08:27 +0200 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2021-10-19 20:08:27 +0200 |
commit | de1d5e6ddd1590c15c0ef51855cd20978cefa053 (patch) | |
tree | 128f3876b4d2e5c43fc44ae5679deaae6d3564bf | |
parent | Support multiple enqueue + dequeue (diff) | |
download | feralbot-de1d5e6ddd1590c15c0ef51855cd20978cefa053.tar.gz feralbot-de1d5e6ddd1590c15c0ef51855cd20978cefa053.tar.bz2 feralbot-de1d5e6ddd1590c15c0ef51855cd20978cefa053.zip |
Fix
-rw-r--r-- | src/index.ts | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/index.ts b/src/index.ts index 3702746..90a8f5b 100644 --- a/src/index.ts +++ b/src/index.ts | |||
@@ -31,13 +31,17 @@ const args = cliArgs.parse<{ | |||
31 | if (args.id) { | 31 | if (args.id) { |
32 | await jobs.postSpecificPicture(args.id); | 32 | await jobs.postSpecificPicture(args.id); |
33 | } else if (args.enqueue) { | 33 | } else if (args.enqueue) { |
34 | console.log(`Enqueueing post ${args.enqueue}...`); | 34 | for (const id of args.enqueue) { |
35 | console.log(`Enqueueing post ${id}...`); | ||
35 | 36 | ||
36 | await queueDb.insertIfNotExists({ provider: "e926", id: args.enqueue }); | 37 | await queueDb.insertIfNotExists({ provider: "e926", id }); |
38 | } | ||
37 | } else if (args.dequeue) { | 39 | } else if (args.dequeue) { |
38 | console.log(`Dequeueing post ${args.dequeue}...`); | 40 | for (const id of args.dequeue) { |
41 | console.log(`Dequeueing post ${id}...`); | ||
39 | 42 | ||
40 | await queueDb.remove({ provider: "e926", id: args.dequeue }); | 43 | await queueDb.remove({ provider: "e926", id }); |
44 | } | ||
41 | } else { | 45 | } else { |
42 | console.log("Reading queue..."); | 46 | console.log("Reading queue..."); |
43 | 47 | ||