Comparing version 1.31.13 to 1.31.14
@@ -170,4 +170,13 @@ /* | ||
setTimeout(function () { | ||
this.sendClientInfo() | ||
this.sendClientInfo('Start') | ||
}.bind(this), 10) | ||
process.on('SIGINT', function () { | ||
self.sendClientInfo('Stop') | ||
}) | ||
process.on('SIGTERM', function () { | ||
self.sendClientInfo('Stop') | ||
}) | ||
process.on('SIGQUIT', function () { | ||
self.sendClientInfo('Stop') | ||
}) | ||
this.startSender() | ||
@@ -180,3 +189,3 @@ } | ||
} | ||
SpmSender.prototype.sendClientInfo = function () { | ||
SpmSender.prototype.sendClientInfo = function (action, terminate) { | ||
if (!this.spmToken) { | ||
@@ -192,5 +201,5 @@ return | ||
var serverInfo = { | ||
title: 'Start ' + packageName + ' ' + programVersion, | ||
title: action + ' ' + packageName + ' ' + programVersion, | ||
host: (process.env.SPM_REPORTED_HOSTNAME || os.hostname()), | ||
message: 'Start ' + packageName + ' ' + programVersion + ' / ' + ' on ' + (process.env.SPM_REPORTED_HOSTNAME || os.hostname()), | ||
message: action + ' ' + packageName + ' ' + programVersion + ' / ' + ' on ' + (process.env.SPM_REPORTED_HOSTNAME || os.hostname()), | ||
tags: info.split(','), | ||
@@ -209,2 +218,6 @@ priority: 0, | ||
} | ||
if (action === 'Stop') { | ||
// give other handlers a chance to clean up before exit | ||
setTimeout(process.exit, 5000) | ||
} | ||
}) | ||
@@ -211,0 +224,0 @@ } |
{ | ||
"name": "spm-agent", | ||
"version": "1.31.13", | ||
"version": "1.31.14", | ||
"description": "Node.js agent framework for SPM by Sematext", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1097
58624
12