diff --git a/src/service/event.batch.service.ts b/src/service/event.batch.service.ts index ce434f1..7b4f3a2 100644 --- a/src/service/event.batch.service.ts +++ b/src/service/event.batch.service.ts @@ -168,7 +168,11 @@ export class EventBatchSvr { const record = await GeneralEvent.saveEvent(event) blockNumber = Math.max(parseInt(event.blockNumber, 16), cfg.fromBlock) 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 diff --git a/start_dev.json b/start_dev.json index d7f590e..9c64510 100644 --- a/start_dev.json +++ b/start_dev.json @@ -2,8 +2,7 @@ "apps": [ { "name": "chain-client", - "script": "npm", - "args": "run prod:api", + "script": "./dist/api.js", "cwd": "/root/code/web_chain_client", "max_memory_restart": "1024M", "log_date_format": "YYYY-MM-DD HH:mm Z", @@ -12,7 +11,44 @@ "instances": 1, "exec_mode": "fork", "env": { + "NODE_ENV": "production", + "NODE_PATH": "./dist" + }, + "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": { "NODE_ENV": "production"