echoapi-cron-scheduler-batch 1.0.6 → 1.0.7

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.
Files changed (2) hide show
  1. package/index.js +2 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -17,7 +17,7 @@ class CronScheduler {
17
17
  constructor(config = {}) {
18
18
  // 配置初始化
19
19
  this.apiUrl = config.apiUrl || process?.env["OPENAPI_DOMAIN"] || "https://ee.apipost.cc";
20
- this.dbFile = config.dbPath || path.resolve(os.tmpdir(), 'echoapi-batch-tasks.sqlite');
20
+ this.dbFile = config.dbPath || path.resolve(process?.env?.TEMP_DIR || os.tmpdir(), 'echoapi-batch-tasks.sqlite');
21
21
  this.workerNum = config.workerNum || os.cpus().length;
22
22
 
23
23
  // 结果聚合收集器:用于收集同一批次下所有 Runner 的结果
@@ -544,7 +544,7 @@ class CronScheduler {
544
544
  process.on('message', async (msg) => {
545
545
  if (msg.action === 'EXECUTE_UNIT') {
546
546
  const { executionId, api_token, test_events, option } = msg.payload;
547
- const socketPath = path.join(os.tmpdir(), `echoapi_${uuidv4()}.sock`);
547
+ const socketPath = path.join(process?.env?.TEMP_DIR || os.tmpdir(), `echoapi_${uuidv4()}.sock`);
548
548
 
549
549
  const server = net.createServer((socket) => {
550
550
  socket.on('data', async (stream) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "echoapi-cron-scheduler-batch",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {