feat(cache): default to off [EE-6293] (#10867)

Co-authored-by: testa113 <testa113>
pull/10870/head
Ali 2023-12-19 12:13:44 +13:00 committed by GitHub
parent 5f1f797281
commit e84dd27e88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 3 additions and 24 deletions

View File

@ -23,21 +23,3 @@ func (migrator *Migrator) updateAppTemplatesVersionForDB110() error {
return migrator.settingsService.UpdateSettings(settings) return migrator.settingsService.UpdateSettings(settings)
} }
// setUseCacheForDB110 sets the user cache to true for all users
func (migrator *Migrator) setUserCacheForDB110() error {
users, err := migrator.userService.ReadAll()
if err != nil {
return err
}
for i := range users {
user := &users[i]
user.UseCache = true
if err := migrator.userService.Update(user.ID, user); err != nil {
return err
}
}
return nil
}

View File

@ -230,7 +230,6 @@ func (m *Migrator) initMigrations() {
) )
m.addMigrations("2.20", m.addMigrations("2.20",
m.updateAppTemplatesVersionForDB110, m.updateAppTemplatesVersionForDB110,
m.setUserCacheForDB110,
) )
// Add new migrations below... // Add new migrations below...

View File

@ -903,7 +903,7 @@
"color": "" "color": ""
}, },
"TokenIssueAt": 0, "TokenIssueAt": 0,
"UseCache": true, "UseCache": false,
"Username": "admin" "Username": "admin"
}, },
{ {
@ -933,11 +933,11 @@
"color": "" "color": ""
}, },
"TokenIssueAt": 0, "TokenIssueAt": 0,
"UseCache": true, "UseCache": false,
"Username": "prabhat" "Username": "prabhat"
} }
], ],
"version": { "version": {
"VERSION": "{\"SchemaVersion\":\"2.20.0\",\"MigratorCount\":2,\"Edition\":1,\"InstanceID\":\"463d5c47-0ea5-4aca-85b1-405ceefee254\"}" "VERSION": "{\"SchemaVersion\":\"2.20.0\",\"MigratorCount\":1,\"Edition\":1,\"InstanceID\":\"463d5c47-0ea5-4aca-85b1-405ceefee254\"}"
} }
} }

View File

@ -65,7 +65,6 @@ func (handler *Handler) adminInit(w http.ResponseWriter, r *http.Request) *httpe
user := &portainer.User{ user := &portainer.User{
Username: payload.Username, Username: payload.Username,
Role: portainer.AdministratorRole, Role: portainer.AdministratorRole,
UseCache: true,
} }
user.Password, err = handler.CryptoService.Hash(payload.Password) user.Password, err = handler.CryptoService.Hash(payload.Password)

View File

@ -65,7 +65,6 @@ func (handler *Handler) userCreate(w http.ResponseWriter, r *http.Request) *http
user = &portainer.User{ user = &portainer.User{
Username: payload.Username, Username: payload.Username,
Role: portainer.UserRole(payload.Role), Role: portainer.UserRole(payload.Role),
UseCache: true,
} }
settings, err := handler.DataStore.Settings().Settings() settings, err := handler.DataStore.Settings().Settings()