Skip to content

Commit 3475cc5

Browse files
committed
get last 8 hour updated servers instead of 3
1 parent d2b8d25 commit 3475cc5

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

app/services/serverworker/serverworker.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ func (w *Worker) Run(ctx context.Context, window time.Duration) error {
109109

110110
// TODO: GetAll needs an "include inactive" flag, and make default duration configurable
111111
// It should also probably just use existing data queried earlier.
112-
// Only retrieve servers active since 3 hours ago
113-
all, err := w.db.GetAll(ctx, time.Duration(-3)*time.Hour)
112+
// Only retrieve servers active since 8 hours ago (Used to be 3, but we got bigger now I guess, so many servers!!!)
113+
all, err := w.db.GetAll(ctx, time.Duration(-8)*time.Hour)
114114
if err != nil {
115115
zap.L().Error("failed to get all servers for metrics",
116116
zap.Error(err))

app/transports/api/servers/h_fulllist.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func (s *service) fulllist(w http.ResponseWriter, r *http.Request) {
1414
queries := r.URL.Query()
1515
since, err := strconv.Atoi(queries.Get("activeSince"))
1616
if err != nil {
17-
since = 3
17+
since = 8 // Used to be 3, but we got bigger now I guess, so many servers!!!
1818
}
1919

2020
// This used to be for getting servers from database directly

app/transports/api/servers/h_gencache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func (s *service) gencache(w http.ResponseWriter, r *http.Request) {
1414
queries := r.URL.Query()
1515
since, err := strconv.Atoi(queries.Get("activeSince"))
1616
if err != nil {
17-
since = 3
17+
since = 8 // Used to be 3, but we got bigger now I guess, so many servers!!!
1818
}
1919

2020
err = s.storer.GenerateCache(r.Context(), time.Duration(-since)*time.Hour)

app/transports/api/servers/h_list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func (s *service) list(w http.ResponseWriter, r *http.Request) {
1515
queries := r.URL.Query()
1616
since, err := strconv.Atoi(queries.Get("activeSince"))
1717
if err != nil {
18-
since = 3
18+
since = 8 // Used to be 3, but we got bigger now I guess, so many servers!!!
1919
}
2020

2121
// This used to be for getting servers from database directly

0 commit comments

Comments
 (0)