mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Another round of db.DefaultContext
refactor (#27103)
Part of #27065 --------- Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
This commit is contained in:
@@ -9,7 +9,6 @@ import (
|
||||
|
||||
activities_model "code.gitea.io/gitea/models/activities"
|
||||
asymkey_model "code.gitea.io/gitea/models/asymkey"
|
||||
"code.gitea.io/gitea/models/db"
|
||||
"code.gitea.io/gitea/models/system"
|
||||
user_model "code.gitea.io/gitea/models/user"
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
@@ -71,8 +70,8 @@ func registerRewriteAllPublicKeys() {
|
||||
Enabled: false,
|
||||
RunAtStart: false,
|
||||
Schedule: "@every 72h",
|
||||
}, func(_ context.Context, _ *user_model.User, _ Config) error {
|
||||
return asymkey_model.RewriteAllPublicKeys()
|
||||
}, func(ctx context.Context, _ *user_model.User, _ Config) error {
|
||||
return asymkey_model.RewriteAllPublicKeys(ctx)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -81,8 +80,8 @@ func registerRewriteAllPrincipalKeys() {
|
||||
Enabled: false,
|
||||
RunAtStart: false,
|
||||
Schedule: "@every 72h",
|
||||
}, func(_ context.Context, _ *user_model.User, _ Config) error {
|
||||
return asymkey_model.RewriteAllPrincipalKeys(db.DefaultContext)
|
||||
}, func(ctx context.Context, _ *user_model.User, _ Config) error {
|
||||
return asymkey_model.RewriteAllPrincipalKeys(ctx)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -168,7 +167,7 @@ func registerDeleteOldSystemNotices() {
|
||||
OlderThan: 365 * 24 * time.Hour,
|
||||
}, func(ctx context.Context, _ *user_model.User, config Config) error {
|
||||
olderThanConfig := config.(*OlderThanConfig)
|
||||
return system.DeleteOldSystemNotices(olderThanConfig.OlderThan)
|
||||
return system.DeleteOldSystemNotices(ctx, olderThanConfig.OlderThan)
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user