Skip to content

Commit 2ecdf81

Browse files
committed
fix dbmem test
1 parent 0fd9aa7 commit 2ecdf81

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

coderd/database/dbmem/dbmem.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4110,7 +4110,9 @@ func (q *FakeQuerier) GetProvisionerJobsByOrganizationAndStatusWithQueuePosition
41104110
slices.SortFunc(rows, func(a, b database.GetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisionerRow) int {
41114111
return b.ProvisionerJob.CreatedAt.Compare(a.ProvisionerJob.CreatedAt)
41124112
})
4113-
4113+
if arg.Limit.Valid && arg.Limit.Int32 > 0 && len(rows) > int(arg.Limit.Int32) {
4114+
rows = rows[:arg.Limit.Int32]
4115+
}
41144116
return rows, nil
41154117
}
41164118

0 commit comments

Comments
 (0)