From ef0e5751cac69cf6024e0100b94b63dda46e98d4 Mon Sep 17 00:00:00 2001 From: Kristina Date: Tue, 12 Feb 2019 13:57:57 -0800 Subject: [PATCH] Ordering records by birthdate --- db/executer.go | 2 +- deploy/docker-compose/docFiles/svalinn.yaml | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/db/executer.go b/db/executer.go index 9eb03bf..ab2c8e5 100644 --- a/db/executer.go +++ b/db/executer.go @@ -42,7 +42,7 @@ type dbDecorator struct { } func (b *dbDecorator) find(out interface{}, where ...interface{}) error { - db := b.Find(out, where...) + db := b.Order("birth_date DESC").Find(out, where...) return db.Error } diff --git a/deploy/docker-compose/docFiles/svalinn.yaml b/deploy/docker-compose/docFiles/svalinn.yaml index 2400338..6a50aaa 100644 --- a/deploy/docker-compose/docFiles/svalinn.yaml +++ b/deploy/docker-compose/docFiles/svalinn.yaml @@ -35,7 +35,7 @@ insertRetries: 0 pruneRetries: 0 getRetries: 0 retryInterval: 10s -defaultTTL: 30s +defaultTTL: 1h db: server: "db:26257" username: "roachadmin" @@ -48,11 +48,13 @@ regexRules: - regex: ".*/online$" tombstoneKey: "online" storePayload: true - ttl: 5m + ruleTTL: 50h + eventType: "state" - regex: ".*/offline$" tombstoneKey: "offline" storePayload: true - ttl: 0s + ruleTTL: 50h + eventType: "state" authHeader: ["YXV0aEhlYWRlcg=="]