fix: rest typings (#835)

* fix: rest typings

* fix: more typings
This commit is contained in:
Skillz4Killz
2021-04-12 11:18:13 -04:00
committed by GitHub
parent af3dbf1564
commit 78a894a4ab
9 changed files with 66 additions and 78 deletions

View File

@@ -30,7 +30,6 @@ export async function processQueue(id: string) {
// IF THIS DOESNT HAVE ANY ITEMS JUST CANCEL, THE CLEANER WILL REMOVE IT.
if (!queuedRequest) return;
const basicURL = rest.simplifyUrl(
queuedRequest.request.url,
queuedRequest.request.method.toUpperCase()
@@ -42,8 +41,9 @@ export async function processQueue(id: string) {
// PAUSE FOR THIS SPECIFC REQUEST
await delay(urlResetIn);
continue;
} // IF A BUCKET EXISTS, CHECK THE BUCKET'S RATE LIMITS
}
// IF A BUCKET EXISTS, CHECK THE BUCKET'S RATE LIMITS
const bucketResetIn = queuedRequest.payload.bucketId
? rest.checkRateLimits(queuedRequest.payload.bucketId)
: false;
@@ -172,7 +172,7 @@ export async function processQueue(id: string) {
} catch (error) {
// SOMETHING WENT WRONG, LOG AND RESPOND WITH ERROR
rest.eventHandlers.fetchFailed(queuedRequest.payload, error);
queuedRequest.request.reject(error);
queuedRequest.request.reject?.(error);
queuedRequest.request.respond({
status: 404,
body: JSON.stringify({ error }),