修改启动脚本

This commit is contained in:
zhl 2020-12-17 13:08:26 +08:00
parent dec318f297
commit 0220c16758
3 changed files with 20 additions and 2 deletions

View File

@ -1,4 +1,5 @@
const os = require('os');
let config = require('./config/config.json');
module.exports = {
apps: [
{
@ -8,7 +9,7 @@ module.exports = {
instances : 1, // scale this up if the proxy becomes the bottleneck
exec_mode : 'cluster',
env: {
REDIS_URL: "redis://127.0.0.1:6379/15"
REDIS_URL: config.redis
}
},
{

View File

@ -8,6 +8,22 @@ let arrUtil = {
;
}
},
/**
* index位置的元素
* @param arr
* @param index
*/
spliceOne(arr: any[], index: number): boolean {
if (index === -1 || index >= arr.length) {
return false;
}
const len = arr.length - 1;
for (let i = index; i < len; i++) {
arr[i] = arr[i + 1];
}
arr.length = len;
return true;
},
/**
* object
* @param arr

View File

@ -4,6 +4,7 @@
},
"files": [
"src/index.ts",
"src/robot.ts",
"src/global.d.ts"
],
"compilerOptions": {