diff options
author | Julien Dessaux | 2023-05-25 01:20:56 +0200 |
---|---|---|
committer | Julien Dessaux | 2023-05-25 01:20:56 +0200 |
commit | b1157af9cd66878623ad1f9fadac862e4990901c (patch) | |
tree | 3e95713b4ede9d292a2bf00af88f36e7cbe12e0d /lib/api.js | |
parent | Rewrote the api rate limiter with promises instead of callbacks (diff) | |
download | spacetraders-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.js | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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)) +} |