This repository was archived by the owner on Aug 9, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdefaults.ts
More file actions
58 lines (48 loc) 路 1.45 KB
/
Copy pathdefaults.ts
File metadata and controls
58 lines (48 loc) 路 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// TODO: Add docs for options and defaults
import * as IORedis from 'ioredis';
export interface RedisOptions extends IORedis.RedisOptions {}
const redisOptions: RedisOptions = {};
export interface QueueOptions {
maxIndividualQueueResultSize?: number;
maxGlobalListSize?: number;
}
const queueOptions: QueueOptions = {
// Currently there is no API to override these defaults
maxIndividualQueueResultSize: 10_000,
maxGlobalListSize: 100_000
};
export interface ConsumerOptions {
workerFnTimeoutMs?: number | null;
stealFromInactiveConsumersAfterMs?: number;
taskBufferSize?: number;
maxRetry?: number;
concurrencyPerInstance?: number;
}
const consumerOptions: ConsumerOptions = {
workerFnTimeoutMs: null,
stealFromInactiveConsumersAfterMs: 300 * 1000, // 5 mins. Only tasks from inactive workers will be taken over.
taskBufferSize: 10,
maxRetry: 0,
concurrencyPerInstance: 1
};
export interface LoggingOptions {
enabled?: boolean;
loggerFn?(message?: any, ...optionalParams: any[]): void;
}
const loggingOptions: LoggingOptions = {
enabled: false,
loggerFn: console.log
};
export const defaultOptions = {
NAMESPACE: '__orkid',
INTERNALS: '__internals',
RESULTLIST: '__orkid:__internals:results',
FAILEDLIST: '__orkid:__internals:failed',
DEADLIST: '__orkid:__internals:dead',
STAT: '__orkid:__internals:stat',
QUENAMES: '__orkid:__internals:qnames',
redisOptions,
queueOptions,
consumerOptions,
loggingOptions
};