mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
Ugly workaround/hotfix for message fetching
This commit is contained in:
parent
499511f79d
commit
8da47e53e6
9 changed files with 31 additions and 14 deletions
|
@ -28,11 +28,11 @@ export class Queue<TQueueFunction extends AnyFn = AnyFn> {
|
|||
return this.queue.length + (this.running ? 1 : 0);
|
||||
}
|
||||
|
||||
public add(fn: TQueueFunction): Promise<void> {
|
||||
const promise = new Promise<void>(resolve => {
|
||||
public add(fn: TQueueFunction): Promise<any> {
|
||||
const promise = new Promise<any>(resolve => {
|
||||
this.queue.push(async () => {
|
||||
await fn();
|
||||
resolve();
|
||||
const result = await fn();
|
||||
resolve(result);
|
||||
});
|
||||
|
||||
if (!this.running) this.next();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue