mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
refactor: resolve async promises, fixed typos, and used inline variable for return (#299)
* Added await in async function, fixed typos and used inline variable for return
* Added await in async function, fixed typos and used inline variable for return
* Revert "Added await in async function, fixed typos and used inline variable for return"
This reverts commit f31caf5d
* Added await in async function, fixed typos and used inline variable for return
* Fixes format
* Fixes format 2
* Fixes format 4475757
* Fixes format 878757854786312378657865785785785785
* Change return to await
* Fixing more issues
* Fixing even more issues
* Fixing even more issues +
* Fixes format
This commit is contained in:
@@ -41,7 +41,7 @@ async function processRateLimitedPaths() {
|
||||
});
|
||||
|
||||
await delay(1000);
|
||||
processRateLimitedPaths();
|
||||
await processRateLimitedPaths();
|
||||
}
|
||||
|
||||
function addToQueue(request: QueuedRequest) {
|
||||
@@ -59,7 +59,7 @@ function addToQueue(request: QueuedRequest) {
|
||||
}
|
||||
|
||||
async function cleanupQueues() {
|
||||
Object.entries(pathQueues).map(([key, value]) => {
|
||||
Object.entries(pathQueues).forEach(([key, value]) => {
|
||||
if (!value.length) {
|
||||
// Remove it entirely
|
||||
delete pathQueues[key];
|
||||
@@ -115,7 +115,7 @@ async function processQueue() {
|
||||
}
|
||||
|
||||
if (Object.keys(pathQueues).length) {
|
||||
cleanupQueues();
|
||||
await cleanupQueues();
|
||||
} else queueInProcess = false;
|
||||
}
|
||||
}
|
||||
@@ -215,7 +215,7 @@ async function runMethod(
|
||||
});
|
||||
}
|
||||
|
||||
// No proxy so we need to handl all rate limiting and such
|
||||
// No proxy so we need to handle all rate limiting and such
|
||||
return new Promise((resolve, reject) => {
|
||||
const callback = async () => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user