Replace more db.DefaultContext (#27628)

Target #27065
This commit is contained in:
Lunny Xiao 2023-10-15 23:46:06 +08:00 committed by GitHub
parent 7480aacdad
commit cddf245c12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 99 additions and 85 deletions

View file

@ -72,7 +72,7 @@ func mustInitCtx(ctx context.Context, fn func(ctx context.Context) error) {
func syncAppConfForGit(ctx context.Context) error {
runtimeState := new(system.RuntimeState)
if err := system.AppState.Get(runtimeState); err != nil {
if err := system.AppState.Get(ctx, runtimeState); err != nil {
return err
}
@ -95,7 +95,7 @@ func syncAppConfForGit(ctx context.Context) error {
log.Info("re-write ssh public keys ...")
mustInitCtx(ctx, asymkey_model.RewriteAllPublicKeys)
return system.AppState.Set(runtimeState)
return system.AppState.Set(ctx, runtimeState)
}
return nil
}