mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	add limit to database entries
This commit is contained in:
		
							parent
							
								
									022c27ab11
								
							
						
					
					
						commit
						7e86867de5
					
				| @ -14,6 +14,7 @@ module.exports = function (db) { | |||||||
|         return db |         return db | ||||||
|             .select(METRICS_COLUMNS) |             .select(METRICS_COLUMNS) | ||||||
|             .from(TABLE) |             .from(TABLE) | ||||||
|  |             .limit(2000) | ||||||
|             .whereRaw('created_at > now() - interval \'7 day\'') |             .whereRaw('created_at > now() - interval \'7 day\'') | ||||||
|             .orderBy('created_at', 'asc') |             .orderBy('created_at', 'asc') | ||||||
|             .map(mapRow); |             .map(mapRow); | ||||||
| @ -24,6 +25,7 @@ module.exports = function (db) { | |||||||
|         return db |         return db | ||||||
|             .select(METRICS_COLUMNS) |             .select(METRICS_COLUMNS) | ||||||
|             .from(TABLE) |             .from(TABLE) | ||||||
|  |             .limit(1000) | ||||||
|             .where('id', '>', lastKnownId) |             .where('id', '>', lastKnownId) | ||||||
|             .orderBy('created_at', 'asc') |             .orderBy('created_at', 'asc') | ||||||
|             .map(mapRow); |             .map(mapRow); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user