1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-11 00:08:30 +01:00

add limit to database entries

This commit is contained in:
sveisvei 2016-11-04 16:15:00 +01:00 committed by Ivar Conradi Østhus
parent 022c27ab11
commit 7e86867de5

View File

@ -14,6 +14,7 @@ module.exports = function (db) {
return db
.select(METRICS_COLUMNS)
.from(TABLE)
.limit(2000)
.whereRaw('created_at > now() - interval \'7 day\'')
.orderBy('created_at', 'asc')
.map(mapRow);
@ -24,6 +25,7 @@ module.exports = function (db) {
return db
.select(METRICS_COLUMNS)
.from(TABLE)
.limit(1000)
.where('id', '>', lastKnownId)
.orderBy('created_at', 'asc')
.map(mapRow);