1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-02 20:35:25 +02:00

Revert "feat(cache): introduce cache option [EE-6293] (#10641)" (#10658)

This reverts commit 2c032f1739.
This commit is contained in:
Ali 2023-11-20 15:08:19 +13:00 committed by GitHub
parent 2c032f1739
commit ecce501cf3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
70 changed files with 45 additions and 418 deletions

View file

@ -23,21 +23,3 @@ func (migrator *Migrator) updateAppTemplatesVersionForDB110() error {
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

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

View file

@ -903,7 +903,6 @@
"color": ""
},
"TokenIssueAt": 0,
"UseCache": true,
"Username": "admin"
},
{
@ -933,11 +932,10 @@
"color": ""
},
"TokenIssueAt": 0,
"UseCache": true,
"Username": "prabhat"
}
],
"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

@ -24,7 +24,6 @@ type userUpdatePayload struct {
Username string `validate:"required" example:"bob"`
Password string `validate:"required" example:"cg9Wgky3"`
NewPassword string `validate:"required" example:"asfj2emv"`
UseCache *bool `validate:"required" example:"true"`
Theme *themePayload
// User role (1 for administrator account and 2 for regular account)
@ -148,10 +147,6 @@ func (handler *Handler) userUpdate(w http.ResponseWriter, r *http.Request) *http
}
}
if payload.UseCache != nil {
user.UseCache = *payload.UseCache
}
if payload.Role != 0 {
user.Role = portainer.UserRole(payload.Role)
user.TokenIssueAt = time.Now().Unix()

View file

@ -1314,10 +1314,9 @@ type (
Username string `json:"Username" example:"bob"`
Password string `json:"Password,omitempty" swaggerignore:"true"`
// User role (1 for administrator account and 2 for regular account)
Role UserRole `json:"Role" example:"1"`
TokenIssueAt int64 `json:"TokenIssueAt" example:"1"`
ThemeSettings UserThemeSettings `json:"ThemeSettings"`
UseCache bool `json:"UseCache" example:"true"`
Role UserRole `json:"Role" example:"1"`
TokenIssueAt int64 `json:"TokenIssueAt" example:"1"`
ThemeSettings UserThemeSettings
// Deprecated fields