@@ -1,7 +1,7 @@
'use strict';
module.exports = {
schedule: {
- cron: '0 26 9 * * *',
+ cron: '0 0 9 * * *',
// interval: '10s', // 时间间隔
type: 'all', // 指定所有的 worker 都需要执行
},
@@ -0,0 +1,17 @@
+'use strict';
+
+const app = '磁盘监控';
+module.exports = {
+ apps: [{
+ name: app, // 应用名称
+ script: './server.js', // 实际启动脚本
+ out: `./logs/${app}.log`,
+ error: `./logs/${app}.err`,
+ watch: [ // 监控变化的目录,一旦变化,自动重启
+ 'app', 'config',
+ ],
+ env: {
+ NODE_ENV: 'production', // 环境参数,当前指定为生产环境
+ },
+ }],
+};
@@ -0,0 +1,9 @@
+// eslint-disable-next-line strict
+const egg = require('egg');
+const workers = Number(1);
+egg.startCluster({
+ workers,
+ baseDir: __dirname,
+});