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

@ -115,7 +115,7 @@ func appendAuthorizedKeysToFile(keys ...*PublicKey) error {
}
// RewriteAllPublicKeys removes any authorized key and rewrite all keys from database again.
// Note: db.GetEngine(db.DefaultContext).Iterate does not get latest data after insert/delete, so we have to call this function
// Note: db.GetEngine(ctx).Iterate does not get latest data after insert/delete, so we have to call this function
// outside any session scope independently.
func RewriteAllPublicKeys(ctx context.Context) error {
// Don't rewrite key if internal server