diff --git a/userapi/storage/postgres/notifications_table.go b/userapi/storage/postgres/notifications_table.go index 459bcc59d..a27c1125e 100644 --- a/userapi/storage/postgres/notifications_table.go +++ b/userapi/storage/postgres/notifications_table.go @@ -103,8 +103,8 @@ func NewPostgresNotificationTable(db *sql.DB) (tables.NotificationTable, error) func (s *notificationsStatements) Clean(ctx context.Context, txn *sql.Tx) error { _, err := sqlutil.TxStmt(txn, s.cleanNotificationsStmt).ExecContext( ctx, - time.Now().AddDate(0, 0, -1).UnixMilli(), // keep non-highlights for a day - time.Now().AddDate(0, -1, 0).UnixMilli(), // keep highlights for a month + time.Now().AddDate(0, 0, -1).UnixNano()/int64(time.Millisecond), // keep non-highlights for a day + time.Now().AddDate(0, -1, 0).UnixNano()/int64(time.Millisecond), // keep highlights for a month ) return err } diff --git a/userapi/storage/sqlite3/notifications_table.go b/userapi/storage/sqlite3/notifications_table.go index bf3fd2329..df8260251 100644 --- a/userapi/storage/sqlite3/notifications_table.go +++ b/userapi/storage/sqlite3/notifications_table.go @@ -103,8 +103,8 @@ func NewSQLiteNotificationTable(db *sql.DB) (tables.NotificationTable, error) { func (s *notificationsStatements) Clean(ctx context.Context, txn *sql.Tx) error { _, err := sqlutil.TxStmt(txn, s.cleanNotificationsStmt).ExecContext( ctx, - time.Now().AddDate(0, 0, -1).UnixMilli(), // keep non-highlights for a day - time.Now().AddDate(0, -1, 0).UnixMilli(), // keep highlights for a month + time.Now().AddDate(0, 0, -1).UnixNano()/int64(time.Millisecond), // keep non-highlights for a day + time.Now().AddDate(0, -1, 0).UnixNano()/int64(time.Millisecond), // keep highlights for a month ) return err }