summaryrefslogtreecommitdiffstats
path: root/src/api/e621/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/e621/index.ts')
-rw-r--r--src/api/e621/index.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/api/e621/index.ts b/src/api/e621/index.ts
index 32b7fc0..5c5fd2a 100644
--- a/src/api/e621/index.ts
+++ b/src/api/e621/index.ts
@@ -2,6 +2,7 @@ import got from "got";
2import config from "../../config"; 2import config from "../../config";
3import fs from "fs/promises"; 3import fs from "fs/promises";
4import path from "path"; 4import path from "path";
5import delay from "../../util/delay";
5 6
6export interface GetPostQuery { 7export interface GetPostQuery {
7 tags: readonly string[]; 8 tags: readonly string[];
@@ -101,7 +102,7 @@ export async function getRandomPost(query: GetPostQuery) {
101 const post = response.posts[postIndex]; 102 const post = response.posts[postIndex];
102 103
103 if (dedupeDb.includes(post.id)) { 104 if (dedupeDb.includes(post.id)) {
104 await new Promise((resolve) => setTimeout(resolve, 1000)); 105 await delay(1000);
105 return getRandomPost(query); 106 return getRandomPost(query);
106 } 107 }
107 108