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 -2
View File
@@ -41,7 +41,7 @@ func (w *startupLogsWriter) Write(p []byte) (int, error) {
w.buf.Reset()
}
err := w.send(w.ctx, Log{
CreatedAt: time.Now().UTC(), // UTC, like database.Now().
CreatedAt: time.Now().UTC(), // UTC, like dbtime.Now().
Level: w.level,
Output: string(partial) + string(p[:nl-cr]),
Source: w.source,
@@ -64,7 +64,7 @@ func (w *startupLogsWriter) Close() error {
if w.buf.Len() > 0 {
defer w.buf.Reset()
return w.send(w.ctx, Log{
CreatedAt: time.Now().UTC(), // UTC, like database.Now().
CreatedAt: time.Now().UTC(), // UTC, like dbtime.Now().
Level: w.level,
Output: w.buf.String(),
Source: w.source,