Skip to content

Commit 82c60e6

Browse files
committed
fix: use dbtime in dbmem query to fix flake
1 parent 0f4f6bd commit 82c60e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

coderd/database/dbmem/dbmem.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7014,7 +7014,7 @@ func (q *FakeQuerier) GetWorkspaceAgentUsageStatsAndLabels(_ context.Context, cr
70147014
}
70157015
// WHERE usage = true AND created_at > now() - '1 minute'::interval
70167016
// GROUP BY user_id, agent_id, workspace_id
7017-
if agentStat.Usage && agentStat.CreatedAt.After(time.Now().Add(-time.Minute)) {
7017+
if agentStat.Usage && agentStat.CreatedAt.After(dbtime.Now().Add(-time.Minute)) {
70187018
val, ok := latestAgentStats[key]
70197019
if !ok {
70207020
latestAgentStats[key] = agentStat

0 commit comments

Comments
 (0)