Skip to content

Commit e610dd5

Browse files
committed
Using dbtime.Now for timestamps which will be used in db
Signed-off-by: Danny Kopping <danny@coder.com>
1 parent d64b57e commit e610dd5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

coderd/notifications/notifier.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"golang.org/x/sync/errgroup"
1111
"golang.org/x/xerrors"
1212

13+
"github.com/coder/coder/v2/coderd/database/dbtime"
1314
"github.com/coder/coder/v2/coderd/notifications/dispatch"
1415
"github.com/coder/coder/v2/coderd/notifications/render"
1516
"github.com/coder/coder/v2/coderd/notifications/types"
@@ -291,7 +292,7 @@ func (n *notifier) newSuccessfulDispatch(msg database.AcquireNotificationMessage
291292
return dispatchResult{
292293
notifier: n.id,
293294
msg: msg.ID,
294-
ts: time.Now(),
295+
ts: dbtime.Now(),
295296
}
296297
}
297298

@@ -311,7 +312,7 @@ func (n *notifier) newFailedDispatch(msg database.AcquireNotificationMessagesRow
311312
return dispatchResult{
312313
notifier: n.id,
313314
msg: msg.ID,
314-
ts: time.Now(),
315+
ts: dbtime.Now(),
315316
err: err,
316317
retryable: retryable,
317318
}
@@ -321,7 +322,7 @@ func (n *notifier) newInhibitedDispatch(msg database.AcquireNotificationMessages
321322
return dispatchResult{
322323
notifier: n.id,
323324
msg: msg.ID,
324-
ts: time.Now(),
325+
ts: dbtime.Now(),
325326
retryable: false,
326327
inhibited: true,
327328
}

0 commit comments

Comments
 (0)