summaryrefslogtreecommitdiff
path: root/lib/api.js
diff options
context:
space:
mode:
authorJulien Dessaux2023-05-25 01:20:56 +0200
committerJulien Dessaux2023-05-25 01:20:56 +0200
commitb1157af9cd66878623ad1f9fadac862e4990901c (patch)
tree3e95713b4ede9d292a2bf00af88f36e7cbe12e0d /lib/api.js
parentRewrote the api rate limiter with promises instead of callbacks (diff)
downloadspacetraders-b1157af9cd66878623ad1f9fadac862e4990901c.tar.gz
spacetraders-b1157af9cd66878623ad1f9fadac862e4990901c.tar.bz2
spacetraders-b1157af9cd66878623ad1f9fadac862e4990901c.zip
Updated the lib for the new api
Diffstat (limited to 'lib/api.js')
-rw-r--r--lib/api.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/api.js b/lib/api.js
index bbb2977..abcd85d 100644
--- a/lib/api.js
+++ b/lib/api.js
@@ -69,3 +69,7 @@ export function debugLog(ctx) {
console.log(`--- ${Date()} -----------------------------------------------------------------------------`);
console.log(JSON.stringify(ctx, null, 2));
}
+
+export function sleep(delay) {
+ return new Promise((resolve) => setTimeout(resolve, delay))
+}