fix(coderd/agentapi): always write agent stats when provided (#12699)

This commit is contained in:
Mathias Fredriksson
2024-03-21 16:47:06 +02:00
committed by GitHub
parent bd6ad88077
commit 9c84fb7fb1
2 changed files with 5 additions and 9 deletions
+2 -2
View File
@@ -47,11 +47,11 @@ func (a *StatsAPI) now() time.Time {
}
func (a *StatsAPI) UpdateStats(ctx context.Context, req *agentproto.UpdateStatsRequest) (*agentproto.UpdateStatsResponse, error) {
// An empty stat means it's just looking for the report interval.
res := &agentproto.UpdateStatsResponse{
ReportInterval: durationpb.New(a.AgentStatsRefreshInterval),
}
if req.Stats == nil || len(req.Stats.ConnectionsByProto) == 0 {
// An empty stat means it's just looking for the report interval.
if req.Stats == nil {
return res, nil
}