优化启动脚本
This commit is contained in:
parent
acfee0ee69
commit
65abad1eb3
@ -168,7 +168,11 @@ export class EventBatchSvr {
|
|||||||
const record = await GeneralEvent.saveEvent(event)
|
const record = await GeneralEvent.saveEvent(event)
|
||||||
blockNumber = Math.max(parseInt(event.blockNumber, 16), cfg.fromBlock)
|
blockNumber = Math.max(parseInt(event.blockNumber, 16), cfg.fromBlock)
|
||||||
if (cfg.eventProcesser && eventProcessers[cfg.eventProcesser]) {
|
if (cfg.eventProcesser && eventProcessers[cfg.eventProcesser]) {
|
||||||
await eventProcessers[cfg.eventProcesser].parseEvent(record)
|
try {
|
||||||
|
await eventProcessers[cfg.eventProcesser].parseEvent(record)
|
||||||
|
} catch (err) {
|
||||||
|
logger.error('process event error: ', err.message || err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return blockNumber
|
return blockNumber
|
||||||
|
@ -2,8 +2,7 @@
|
|||||||
"apps": [
|
"apps": [
|
||||||
{
|
{
|
||||||
"name": "chain-client",
|
"name": "chain-client",
|
||||||
"script": "npm",
|
"script": "./dist/api.js",
|
||||||
"args": "run prod:api",
|
|
||||||
"cwd": "/root/code/web_chain_client",
|
"cwd": "/root/code/web_chain_client",
|
||||||
"max_memory_restart": "1024M",
|
"max_memory_restart": "1024M",
|
||||||
"log_date_format": "YYYY-MM-DD HH:mm Z",
|
"log_date_format": "YYYY-MM-DD HH:mm Z",
|
||||||
@ -12,7 +11,44 @@
|
|||||||
"instances": 1,
|
"instances": 1,
|
||||||
"exec_mode": "fork",
|
"exec_mode": "fork",
|
||||||
"env": {
|
"env": {
|
||||||
|
"NODE_ENV": "production",
|
||||||
|
"NODE_PATH": "./dist"
|
||||||
|
},
|
||||||
|
"env_production": {
|
||||||
"NODE_ENV": "production"
|
"NODE_ENV": "production"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "chain-scriptions",
|
||||||
|
"script": "./dist/scriptions.js",
|
||||||
|
"cwd": "/root/code/web_chain_client",
|
||||||
|
"max_memory_restart": "1024M",
|
||||||
|
"log_date_format": "YYYY-MM-DD HH:mm Z",
|
||||||
|
"watch": false,
|
||||||
|
"ignore_watch": ["node_modules", "logs", "fixtures", "tasks"],
|
||||||
|
"instances": 1,
|
||||||
|
"exec_mode": "fork",
|
||||||
|
"env": {
|
||||||
|
"NODE_ENV": "production",
|
||||||
|
"NODE_PATH": "./dist"
|
||||||
|
},
|
||||||
|
"env_production": {
|
||||||
|
"NODE_ENV": "production"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "chain-events",
|
||||||
|
"script": "./dist/events.js",
|
||||||
|
"cwd": "/root/code/web_chain_client",
|
||||||
|
"max_memory_restart": "1024M",
|
||||||
|
"log_date_format": "YYYY-MM-DD HH:mm Z",
|
||||||
|
"watch": false,
|
||||||
|
"ignore_watch": ["node_modules", "logs", "fixtures", "tasks"],
|
||||||
|
"instances": 1,
|
||||||
|
"exec_mode": "fork",
|
||||||
|
"env": {
|
||||||
|
"NODE_ENV": "production",
|
||||||
|
"NODE_PATH": "./dist"
|
||||||
},
|
},
|
||||||
"env_production": {
|
"env_production": {
|
||||||
"NODE_ENV": "production"
|
"NODE_ENV": "production"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user