Skip to content

Commit

Permalink
fix: make the clocks sync
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
  • Loading branch information
caarlos0 committed Aug 10, 2021
1 parent 956959c commit 8ee89f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func CloseTasks(db *badger.DB) error {
if !task.EndAt.IsZero() {
return nil
}
task.EndAt = time.Now()
task.EndAt = time.Now().Truncate(time.Second)
log.Println("closing", task.Title)
return txn.Set(k, task.Bytes())
})
Expand Down Expand Up @@ -94,7 +94,7 @@ func CreateTask(db *badger.DB, t string) error {
return txn.Set([]byte(id), model.Task{
ID: s,
Title: t,
StartAt: time.Now(),
StartAt: time.Now().Truncate(time.Second),
}.Bytes())
})
}
Expand Down

0 comments on commit 8ee89f4

Please sign in to comment.