refactor(coderd/database): split Time and Now into dbtime package (#9482)

Ref: #9380
This commit is contained in:
Mathias Fredriksson
2023-09-01 16:50:12 +00:00
committed by GitHub
parent 702b064cac
commit 19d7da3d24
89 changed files with 466 additions and 390 deletions
+2 -1
View File
@@ -15,6 +15,7 @@ import (
"github.com/coder/coder/v2/coderd/database"
"github.com/coder/coder/v2/coderd/database/db2sdk"
"github.com/coder/coder/v2/coderd/database/dbauthz"
"github.com/coder/coder/v2/coderd/database/dbtime"
"github.com/coder/coder/v2/coderd/schedule"
"github.com/coder/coder/v2/coderd/wsbuilder"
"github.com/coder/coder/v2/codersdk"
@@ -181,7 +182,7 @@ func (e *Executor) runOnce(t time.Time) Stats {
ws, err = tx.UpdateWorkspaceDormantDeletingAt(e.ctx, database.UpdateWorkspaceDormantDeletingAtParams{
ID: ws.ID,
DormantAt: sql.NullTime{
Time: database.Now(),
Time: dbtime.Now(),
Valid: true,
},
})