Skip to content

Commit 6cad656

Browse files
committed
fixup! feat: clean up expired devices
1 parent 504a27b commit 6cad656

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

database/client.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func (d *GormDatabase) GetClientByToken(token string) (*model.Client, error) {
3636
// CreateClient creates a client.
3737
func (d *GormDatabase) CreateClient(client *model.Client) error {
3838
if client.CreatedAt.IsZero() {
39-
client.CreatedAt = d.DB.Config.NowFunc()
39+
client.CreatedAt = d.DB.NowFunc()
4040
}
4141
client.PopulateExpiresAt()
4242
return d.DB.Create(client).Error
@@ -107,6 +107,5 @@ func (d *GormDatabase) CleanupExpiredClients(now time.Time) ([]*model.Client, er
107107
}
108108

109109
func (d *GormDatabase) notExpired(tx *gorm.DB) *gorm.DB {
110-
return tx.Where("expires_at IS NULL OR expires_at > ?", d.DB.Config.NowFunc())
110+
return tx.Where("expires_at IS NULL OR expires_at > ?", d.DB.NowFunc())
111111
}
112-

0 commit comments

Comments
 (0)