mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
Queue: allow overriding queue timeout
This commit is contained in:
parent
6f95b7d006
commit
76b9cb6b0c
1 changed files with 7 additions and 1 deletions
|
@ -1,9 +1,15 @@
|
|||
type QueueFn = (...args: any[]) => Promise<any>;
|
||||
|
||||
const DEFAULT_TIMEOUT = 10 * 1000;
|
||||
|
||||
export class Queue {
|
||||
protected running: boolean = false;
|
||||
protected queue: QueueFn[] = [];
|
||||
protected timeout: number = 10 * 1000;
|
||||
protected timeout: number;
|
||||
|
||||
constructor(timeout = DEFAULT_TIMEOUT) {
|
||||
this.timeout = timeout;
|
||||
}
|
||||
|
||||
public add(fn) {
|
||||
const promise = new Promise(resolve => {
|
||||
|
|
Loading…
Add table
Reference in a new issue