mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: use nil map on agent stats to check if report interval should be returned (#6479)
See https://github.com/coder/coder/actions/runs/4350638262/jobs/7601537088
This commit is contained in:
@@ -304,6 +304,9 @@ func (q *fakeQuerier) GetTemplateDAUs(_ context.Context, templateID uuid.UUID) (
|
||||
if as.TemplateID != templateID {
|
||||
continue
|
||||
}
|
||||
if as.ConnectionCount == 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
date := as.CreatedAt.Truncate(time.Hour * 24)
|
||||
|
||||
@@ -341,6 +344,9 @@ func (q *fakeQuerier) GetDeploymentDAUs(_ context.Context) ([]database.GetDeploy
|
||||
seens := make(map[time.Time]map[uuid.UUID]struct{})
|
||||
|
||||
for _, as := range q.workspaceAgentStats {
|
||||
if as.ConnectionCount == 0 {
|
||||
continue
|
||||
}
|
||||
date := as.CreatedAt.Truncate(time.Hour * 24)
|
||||
|
||||
dateEntry := seens[date]
|
||||
|
||||
Reference in New Issue
Block a user