mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-01 03:03:10 -06:00
Fix the milliseconds
This commit is contained in:
parent
db24245be1
commit
e09019f68c
|
|
@ -103,8 +103,8 @@ func NewPostgresNotificationTable(db *sql.DB) (tables.NotificationTable, error)
|
||||||
func (s *notificationsStatements) Clean(ctx context.Context, txn *sql.Tx) error {
|
func (s *notificationsStatements) Clean(ctx context.Context, txn *sql.Tx) error {
|
||||||
_, err := sqlutil.TxStmt(txn, s.cleanNotificationsStmt).ExecContext(
|
_, err := sqlutil.TxStmt(txn, s.cleanNotificationsStmt).ExecContext(
|
||||||
ctx,
|
ctx,
|
||||||
time.Now().AddDate(0, 0, -1).UnixMilli(), // keep non-highlights for a day
|
time.Now().AddDate(0, 0, -1).UnixNano()/int64(time.Millisecond), // keep non-highlights for a day
|
||||||
time.Now().AddDate(0, -1, 0).UnixMilli(), // keep highlights for a month
|
time.Now().AddDate(0, -1, 0).UnixNano()/int64(time.Millisecond), // keep highlights for a month
|
||||||
)
|
)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -103,8 +103,8 @@ func NewSQLiteNotificationTable(db *sql.DB) (tables.NotificationTable, error) {
|
||||||
func (s *notificationsStatements) Clean(ctx context.Context, txn *sql.Tx) error {
|
func (s *notificationsStatements) Clean(ctx context.Context, txn *sql.Tx) error {
|
||||||
_, err := sqlutil.TxStmt(txn, s.cleanNotificationsStmt).ExecContext(
|
_, err := sqlutil.TxStmt(txn, s.cleanNotificationsStmt).ExecContext(
|
||||||
ctx,
|
ctx,
|
||||||
time.Now().AddDate(0, 0, -1).UnixMilli(), // keep non-highlights for a day
|
time.Now().AddDate(0, 0, -1).UnixNano()/int64(time.Millisecond), // keep non-highlights for a day
|
||||||
time.Now().AddDate(0, -1, 0).UnixMilli(), // keep highlights for a month
|
time.Now().AddDate(0, -1, 0).UnixNano()/int64(time.Millisecond), // keep highlights for a month
|
||||||
)
|
)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue