mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
refactor(coderd/database): split Time and Now into dbtime package (#9482)
Ref: #9380
This commit is contained in:
committed by
GitHub
parent
702b064cac
commit
19d7da3d24
@@ -19,7 +19,7 @@ import (
|
||||
|
||||
"cdr.dev/slog"
|
||||
"github.com/coder/coder/v2/agent/agentssh"
|
||||
"github.com/coder/coder/v2/coderd/database"
|
||||
"github.com/coder/coder/v2/coderd/database/dbtime"
|
||||
"github.com/coder/coder/v2/coderd/httpapi"
|
||||
"github.com/coder/coder/v2/coderd/httpmw"
|
||||
"github.com/coder/coder/v2/coderd/tracing"
|
||||
@@ -600,7 +600,7 @@ func (s *Server) proxyWorkspaceApp(rw http.ResponseWriter, r *http.Request, appT
|
||||
s.collectStats(report)
|
||||
defer func() {
|
||||
// We must use defer here because ServeHTTP may panic.
|
||||
report.SessionEndedAt = database.Now()
|
||||
report.SessionEndedAt = dbtime.Now()
|
||||
s.collectStats(report)
|
||||
}()
|
||||
|
||||
@@ -700,7 +700,7 @@ func (s *Server) workspaceAgentPTY(rw http.ResponseWriter, r *http.Request) {
|
||||
report := newStatsReportFromSignedToken(*appToken)
|
||||
s.collectStats(report)
|
||||
defer func() {
|
||||
report.SessionEndedAt = database.Now()
|
||||
report.SessionEndedAt = dbtime.Now()
|
||||
s.collectStats(report)
|
||||
}()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user