write analytics before exiting

This commit is contained in:
Barış Soner Uşaklı
2018-10-24 12:25:05 -04:00
parent 8abef4c101
commit 1d15449076

View File

@@ -146,6 +146,10 @@ function shutdown(code) {
}, },
function (next) { function (next) {
winston.info('[app] Web server closed to connections.'); winston.info('[app] Web server closed to connections.');
require('./analytics').writeData(next);
},
function (next) {
winston.info('[app] Live analytics saved.');
require('./database').close(next); require('./database').close(next);
}, },
], function (err) { ], function (err) {