mirror of
https://github.com/portainer/portainer.git
synced 2025-08-04 21:35:23 +02:00
feat(cache): introduce cache option [EE-6293] (#10672)
Co-authored-by: testa113 <testa113>
This commit is contained in:
parent
57ed6ae6a6
commit
4096bb562d
71 changed files with 421 additions and 49 deletions
|
@ -23,3 +23,21 @@ 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
|
||||
}
|
||||
|
|
|
@ -228,9 +228,9 @@ func (m *Migrator) initMigrations() {
|
|||
m.migrateDockerDesktopExtensionSetting,
|
||||
m.updateEdgeStackStatusForDB100,
|
||||
)
|
||||
|
||||
m.addMigrations("2.20",
|
||||
m.updateAppTemplatesVersionForDB110,
|
||||
m.setUserCacheForDB110,
|
||||
)
|
||||
|
||||
// Add new migrations below...
|
||||
|
|
|
@ -903,6 +903,7 @@
|
|||
"color": ""
|
||||
},
|
||||
"TokenIssueAt": 0,
|
||||
"UseCache": true,
|
||||
"Username": "admin"
|
||||
},
|
||||
{
|
||||
|
@ -932,10 +933,11 @@
|
|||
"color": ""
|
||||
},
|
||||
"TokenIssueAt": 0,
|
||||
"UseCache": true,
|
||||
"Username": "prabhat"
|
||||
}
|
||||
],
|
||||
"version": {
|
||||
"VERSION": "{\"SchemaVersion\":\"2.20.0\",\"MigratorCount\":1,\"Edition\":1,\"InstanceID\":\"463d5c47-0ea5-4aca-85b1-405ceefee254\"}"
|
||||
"VERSION": "{\"SchemaVersion\":\"2.20.0\",\"MigratorCount\":2,\"Edition\":1,\"InstanceID\":\"463d5c47-0ea5-4aca-85b1-405ceefee254\"}"
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue