1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-03-27 00:19:39 +01:00

only log if num of cleaned is above 0

This commit is contained in:
sveisvei 2016-12-04 22:12:35 +01:00 committed by Ivar Conradi Østhus
parent b5b846835b
commit a1303f4c42
2 changed files with 2 additions and 2 deletions

View File

@ -30,7 +30,7 @@ class ClientInstanceStore {
this.db(TABLE) this.db(TABLE)
.whereRaw('created_at < now() - interval \'2 days\'') .whereRaw('created_at < now() - interval \'2 days\'')
.del() .del()
.then((res) => logger.info(`Deleted ${res} instances`)); .then((res) => res > 0 && logger.info(`Deleted ${res} instances`));
} }
updateRow (details) { updateRow (details) {

View File

@ -24,7 +24,7 @@ class ClientMetricsDb {
this.db(TABLE) this.db(TABLE)
.whereRaw('created_at < now() - interval \'1 hour\'') .whereRaw('created_at < now() - interval \'1 hour\'')
.del() .del()
.then((res) => logger.info(`Deleted ${res} metrics`)); .then((res) => res > 0 && logger.info(`Deleted ${res} metrics`));
} }
// Insert new client metrics // Insert new client metrics