@whyour/qinglong 2.21.0-10 → 2.21.0-11

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@whyour/qinglong",
3
3
  "packageManager": "pnpm@8.3.1",
4
- "version": "2.21.0-10",
4
+ "version": "2.21.0-11",
5
5
  "description": "Timed task management platform supporting Python3, JavaScript, Shell, Typescript",
6
6
  "repository": {
7
7
  "type": "git",
@@ -36,6 +36,7 @@ const typedi_1 = require("typedi");
36
36
  const config_1 = __importDefault(require("./config"));
37
37
  const logger_1 = __importDefault(require("./loaders/logger"));
38
38
  const monitoring_1 = require("./middlewares/monitoring");
39
+ const util_1 = require("./config/util");
39
40
  class Application {
40
41
  constructor() {
41
42
  this.isShuttingDown = false;
@@ -62,7 +63,7 @@ class Application {
62
63
  }
63
64
  }
64
65
  catch (error) {
65
- logger_1.default.error('Failed to start application:', error);
66
+ logger_1.default.error(`Failed to start application:\n${(0, util_1.errStack)(error)}`);
66
67
  process.exit(1);
67
68
  }
68
69
  }
@@ -76,7 +77,7 @@ class Application {
76
77
  this.httpWorker = this.forkWorker('http');
77
78
  })
78
79
  .catch((error) => {
79
- logger_1.default.error('[boot] Failed to wait for gRPC worker:', error);
80
+ logger_1.default.error(`[boot] Failed to wait for gRPC worker:\n${(0, util_1.errStack)(error)}`);
80
81
  process.exit(1);
81
82
  });
82
83
  cluster_1.default.on('exit', (worker, code, signal) => {
@@ -97,12 +98,12 @@ class Application {
97
98
  logger_1.default.info('Sent reregister-crons message to HTTP worker');
98
99
  }
99
100
  catch (error) {
100
- logger_1.default.error('Failed to send reregister-crons message:', error);
101
+ logger_1.default.error(`Failed to send reregister-crons message:\n${(0, util_1.errStack)(error)}`);
101
102
  }
102
103
  }
103
104
  })
104
105
  .catch((error) => {
105
- logger_1.default.error('Failed to restart gRPC worker:', error);
106
+ logger_1.default.error(`Failed to restart gRPC worker:\n${(0, util_1.errStack)(error)}`);
106
107
  process.exit(1);
107
108
  });
108
109
  }
@@ -175,7 +176,7 @@ class Application {
175
176
  worker.send('shutdown');
176
177
  }
177
178
  catch (error) {
178
- logger_1.default.warn(`Failed to send shutdown to worker ${worker.process.pid}:`, error);
179
+ logger_1.default.warn(`Failed to send shutdown to worker ${worker.process.pid}:\n${(0, util_1.errStack)(error)}`);
179
180
  }
180
181
  });
181
182
  workerPromises.push(exitPromise);
@@ -194,7 +195,7 @@ class Application {
194
195
  process.exit(0);
195
196
  }
196
197
  catch (error) {
197
- logger_1.default.error('Error during worker shutdown:', error);
198
+ logger_1.default.error(`Error during worker shutdown:\n${(0, util_1.errStack)(error)}`);
198
199
  process.exit(1);
199
200
  }
200
201
  };
@@ -219,7 +220,7 @@ class Application {
219
220
  (_a = process.send) === null || _a === void 0 ? void 0 : _a.call(process, 'ready');
220
221
  }
221
222
  catch (error) {
222
- logger_1.default.error(`[boot] ${serviceType} worker failed:`, error);
223
+ logger_1.default.error(`[boot] ${serviceType} worker failed:\n${(0, util_1.errStack)(error)}`);
223
224
  process.exit(1);
224
225
  }
225
226
  }
@@ -258,7 +259,7 @@ class Application {
258
259
  logger_1.default.info('[boot] Cron jobs re-registered successfully');
259
260
  }
260
261
  catch (error) {
261
- logger_1.default.error('[boot] Failed to re-register cron jobs:', error);
262
+ logger_1.default.error(`[boot] Failed to re-register cron jobs:\n${(0, util_1.errStack)(error)}`);
262
263
  }
263
264
  }
264
265
  });
@@ -281,14 +282,14 @@ class Application {
281
282
  process.exit(0);
282
283
  }
283
284
  catch (error) {
284
- logger_1.default.error(`[${serviceType}] Error during shutdown:`, error);
285
+ logger_1.default.error(`[${serviceType}] Error during shutdown:\n${(0, util_1.errStack)(error)}`);
285
286
  process.exit(1);
286
287
  }
287
288
  }
288
289
  }
289
290
  const app = new Application();
290
291
  app.start().catch((error) => {
291
- logger_1.default.error('🙅‍♀️ Application failed to start:', error);
292
+ logger_1.default.error(`🙅‍♀️ Application failed to start:\n${(0, util_1.errStack)(error)}`);
292
293
  process.exit(1);
293
294
  });
294
295
  //# sourceMappingURL=app.js.map
@@ -29,7 +29,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
29
29
  return (mod && mod.__esModule) ? mod : { "default": mod };
30
30
  };
31
31
  Object.defineProperty(exports, "__esModule", { value: true });
32
- exports.updateLinuxMirrorFile = exports.detectOS = exports.isDemoEnv = exports.getUninstallCommand = exports.getInstallCommand = exports.getGetCommand = exports.setSystemTimezone = exports.rmPath = exports.safeJSONParse = exports.getUniqPath = exports.parseContentVersion = exports.parseVersion = exports.killAllTasks = exports.getAllPids = exports.getPid = exports.killTask = exports.psTree = exports.parseBody = exports.parseHeaders = exports.promiseExecSuccess = exports.promiseExec = exports.readDir = exports.readDirs = exports.dirSort = exports.concurrentRun = exports.handleLogPath = exports.createFile = exports.fileExist = exports.getPlatform = exports.getToken = exports.getLastModifyFilePath = exports.removeAnsi = exports.getFileContentByName = void 0;
32
+ exports.updateLinuxMirrorFile = exports.detectOS = exports.isDemoEnv = exports.getUninstallCommand = exports.getInstallCommand = exports.getGetCommand = exports.setSystemTimezone = exports.rmPath = exports.errStack = exports.safeJSONParse = exports.getUniqPath = exports.parseContentVersion = exports.parseVersion = exports.killAllTasks = exports.getAllPids = exports.getPid = exports.killTask = exports.psTree = exports.parseBody = exports.parseHeaders = exports.promiseExecSuccess = exports.promiseExec = exports.readDir = exports.readDirs = exports.dirSort = exports.concurrentRun = exports.handleLogPath = exports.createFile = exports.fileExist = exports.getPlatform = exports.getToken = exports.getLastModifyFilePath = exports.removeAnsi = exports.getFileContentByName = void 0;
33
33
  const fs = __importStar(require("fs/promises"));
34
34
  const path = __importStar(require("path"));
35
35
  const child_process_1 = require("child_process");
@@ -503,6 +503,12 @@ function safeJSONParse(value) {
503
503
  }
504
504
  }
505
505
  exports.safeJSONParse = safeJSONParse;
506
+ function errStack(error) {
507
+ return error instanceof Error && error.stack
508
+ ? error.stack
509
+ : String(error);
510
+ }
511
+ exports.errStack = errStack;
506
512
  async function rmPath(path) {
507
513
  try {
508
514
  const _exsit = await fileExist(path);