@jayfong/x-server 1.33.11 → 1.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -16,7 +16,12 @@ function defineTask(options) {
|
|
|
16
16
|
maxRetriesPerRequest: null,
|
|
17
17
|
enableReadyCheck: false
|
|
18
18
|
},
|
|
19
|
-
prefix: `${_x.x.appId}_task
|
|
19
|
+
prefix: `${_x.x.appId}_task`,
|
|
20
|
+
defaultJobOptions: {
|
|
21
|
+
// 都设为 true 防止占用内存
|
|
22
|
+
removeOnComplete: true,
|
|
23
|
+
removeOnFail: true
|
|
24
|
+
}
|
|
20
25
|
});
|
|
21
26
|
queue.process(options.concurrency || 1, async job => {
|
|
22
27
|
return options.handle(job.data);
|
package/lib/core/define_task.js
CHANGED
|
@@ -7,7 +7,12 @@ export function defineTask(options) {
|
|
|
7
7
|
maxRetriesPerRequest: null,
|
|
8
8
|
enableReadyCheck: false
|
|
9
9
|
},
|
|
10
|
-
prefix: `${x.appId}_task
|
|
10
|
+
prefix: `${x.appId}_task`,
|
|
11
|
+
defaultJobOptions: {
|
|
12
|
+
// 都设为 true 防止占用内存
|
|
13
|
+
removeOnComplete: true,
|
|
14
|
+
removeOnFail: true
|
|
15
|
+
}
|
|
11
16
|
});
|
|
12
17
|
queue.process(options.concurrency || 1, async job => {
|
|
13
18
|
return options.handle(job.data);
|