don't panic if no data, improve log (#11581)

This commit is contained in:
swayne275 2021-05-11 10:41:57 -06:00 committed by GitHub
parent ffda908b15
commit f467d86805
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -1577,7 +1577,7 @@ func (a *ActivityLog) precomputedQueryWorker() error {
}
lastMonth := intent.PreviousMonth
a.logger.Info("computing queries", "month", lastMonth)
a.logger.Info("computing queries", "month", time.Unix(lastMonth, 0).UTC())
times, err := a.getMostRecentActivityLogSegment(ctx)
if err != nil {

View File

@ -1808,6 +1808,10 @@ func TestActivityLog_EndOfMonth(t *testing.T) {
if err != nil {
t.Fatal(err)
}
if intentRaw == nil {
t.Fatal("no intent log present")
}
var intent ActivityIntentLog
err = intentRaw.DecodeJSON(&intent)
if err != nil {