Commit 7c3d747d authored by Mark Tyneway's avatar Mark Tyneway

dtl: cleanly catch sigterm and sigint

parent f5ba1465
...@@ -53,6 +53,15 @@ type ethNetwork = 'mainnet' | 'kovan' | 'goerli' ...@@ -53,6 +53,15 @@ type ethNetwork = 'mainnet' | 'kovan' | 'goerli'
sentryTraceRate: config.ufloat('sentry-trace-rate', 0.05), sentryTraceRate: config.ufloat('sentry-trace-rate', 0.05),
}) })
const stop = async (signal) => {
console.log(`"{"msg": "${signal} - Stopping data-transport layer"}"`)
await service.stop()
process.exit()
}
process.on('SIGTERM', stop)
process.on('SIGINT', stop)
await service.start() await service.start()
} catch (err) { } catch (err) {
console.error( console.error(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment