mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-01 03:03:10 -06:00
Use process context
This commit is contained in:
parent
e09019f68c
commit
37b93377b5
|
|
@ -15,7 +15,6 @@
|
||||||
package userapi
|
package userapi
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
|
@ -90,7 +89,7 @@ func NewInternalAPI(
|
||||||
var cleanOldNotifs func()
|
var cleanOldNotifs func()
|
||||||
cleanOldNotifs = func() {
|
cleanOldNotifs = func() {
|
||||||
logrus.Infof("Cleaning old notifications")
|
logrus.Infof("Cleaning old notifications")
|
||||||
if err := db.DeleteOldNotifications(context.Background()); err != nil {
|
if err := db.DeleteOldNotifications(base.Context()); err != nil {
|
||||||
logrus.WithError(err).Error("Failed to clean old notifications")
|
logrus.WithError(err).Error("Failed to clean old notifications")
|
||||||
}
|
}
|
||||||
time.AfterFunc(time.Hour, cleanOldNotifs)
|
time.AfterFunc(time.Hour, cleanOldNotifs)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue