allowing disabling persistence of caches
Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
package revaconfig
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/owncloud/ocis/v2/services/storage-users/pkg/config"
|
||||
)
|
||||
|
||||
@@ -74,28 +72,31 @@ func StorageUsersConfigFromStruct(cfg *config.Config) map[string]interface{} {
|
||||
"nats_enable_tls": cfg.Events.EnableTLS,
|
||||
"data_txs": map[string]interface{}{
|
||||
"simple": map[string]interface{}{
|
||||
"cache_store": cfg.StatCache.Store,
|
||||
"cache_nodes": cfg.StatCache.Nodes,
|
||||
"cache_database": cfg.StatCache.Database,
|
||||
"cache_ttl": cfg.StatCache.TTL / time.Second,
|
||||
"cache_size": cfg.StatCache.Size,
|
||||
"cache_table": "stat",
|
||||
"cache_store": cfg.StatCache.Store,
|
||||
"cache_nodes": cfg.StatCache.Nodes,
|
||||
"cache_database": cfg.StatCache.Database,
|
||||
"cache_ttl": cfg.StatCache.TTL,
|
||||
"cache_size": cfg.StatCache.Size,
|
||||
"cache_table": "stat",
|
||||
"cache_disable_persistence": cfg.StatCache.DisablePersistence,
|
||||
},
|
||||
"spaces": map[string]interface{}{
|
||||
"cache_store": cfg.StatCache.Store,
|
||||
"cache_nodes": cfg.StatCache.Nodes,
|
||||
"cache_database": cfg.StatCache.Database,
|
||||
"cache_ttl": cfg.StatCache.TTL / time.Second,
|
||||
"cache_size": cfg.StatCache.Size,
|
||||
"cache_table": "stat",
|
||||
"cache_store": cfg.StatCache.Store,
|
||||
"cache_nodes": cfg.StatCache.Nodes,
|
||||
"cache_database": cfg.StatCache.Database,
|
||||
"cache_ttl": cfg.StatCache.TTL,
|
||||
"cache_size": cfg.StatCache.Size,
|
||||
"cache_table": "stat",
|
||||
"cache_disable_persistence": cfg.StatCache.DisablePersistence,
|
||||
},
|
||||
"tus": map[string]interface{}{
|
||||
"cache_store": cfg.StatCache.Store,
|
||||
"cache_nodes": cfg.StatCache.Nodes,
|
||||
"cache_database": cfg.StatCache.Database,
|
||||
"cache_ttl": cfg.StatCache.TTL / time.Second,
|
||||
"cache_size": cfg.StatCache.Size,
|
||||
"cache_table": "stat",
|
||||
"cache_store": cfg.StatCache.Store,
|
||||
"cache_nodes": cfg.StatCache.Nodes,
|
||||
"cache_database": cfg.StatCache.Database,
|
||||
"cache_ttl": cfg.StatCache.TTL,
|
||||
"cache_size": cfg.StatCache.Size,
|
||||
"cache_table": "stat",
|
||||
"cache_disable_persistence": cfg.StatCache.DisablePersistence,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package revaconfig
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/owncloud/ocis/v2/services/storage-users/pkg/config"
|
||||
)
|
||||
|
||||
@@ -135,25 +133,28 @@ func Ocis(cfg *config.Config) map[string]interface{} {
|
||||
"asyncfileuploads": cfg.Drivers.OCIS.AsyncUploads,
|
||||
"max_quota": cfg.Drivers.OCIS.MaxQuota,
|
||||
"statcache": map[string]interface{}{
|
||||
"cache_store": cfg.StatCache.Store,
|
||||
"cache_nodes": cfg.StatCache.Nodes,
|
||||
"cache_database": cfg.StatCache.Database,
|
||||
"cache_ttl": cfg.StatCache.TTL / time.Second,
|
||||
"cache_size": cfg.StatCache.Size,
|
||||
"cache_store": cfg.StatCache.Store,
|
||||
"cache_nodes": cfg.StatCache.Nodes,
|
||||
"cache_database": cfg.StatCache.Database,
|
||||
"cache_ttl": cfg.StatCache.TTL,
|
||||
"cache_size": cfg.StatCache.Size,
|
||||
"cache_disable_persistence": cfg.StatCache.DisablePersistence,
|
||||
},
|
||||
"filemetadatacache": map[string]interface{}{
|
||||
"cache_store": cfg.FilemetadataCache.Store,
|
||||
"cache_nodes": cfg.FilemetadataCache.Nodes,
|
||||
"cache_database": cfg.FilemetadataCache.Database,
|
||||
"cache_ttl": cfg.FilemetadataCache.TTL / time.Second,
|
||||
"cache_size": cfg.FilemetadataCache.Size,
|
||||
"cache_store": cfg.FilemetadataCache.Store,
|
||||
"cache_nodes": cfg.FilemetadataCache.Nodes,
|
||||
"cache_database": cfg.FilemetadataCache.Database,
|
||||
"cache_ttl": cfg.FilemetadataCache.TTL,
|
||||
"cache_size": cfg.FilemetadataCache.Size,
|
||||
"cache_disable_persistence": cfg.FilemetadataCache.DisablePersistence,
|
||||
},
|
||||
"idcache": map[string]interface{}{
|
||||
"cache_store": cfg.IDCache.Store,
|
||||
"cache_nodes": cfg.IDCache.Nodes,
|
||||
"cache_database": cfg.IDCache.Database,
|
||||
"cache_ttl": cfg.IDCache.TTL / time.Second,
|
||||
"cache_size": cfg.IDCache.Size,
|
||||
"cache_store": cfg.IDCache.Store,
|
||||
"cache_nodes": cfg.IDCache.Nodes,
|
||||
"cache_database": cfg.IDCache.Database,
|
||||
"cache_ttl": cfg.IDCache.TTL,
|
||||
"cache_size": cfg.IDCache.Size,
|
||||
"cache_disable_persistence": cfg.IDCache.DisablePersistence,
|
||||
},
|
||||
"events": map[string]interface{}{
|
||||
"natsaddress": cfg.Events.Addr,
|
||||
@@ -193,25 +194,28 @@ func OcisNoEvents(cfg *config.Config) map[string]interface{} {
|
||||
"max_concurrency": cfg.Drivers.OCIS.MaxConcurrency,
|
||||
"max_quota": cfg.Drivers.OCIS.MaxQuota,
|
||||
"statcache": map[string]interface{}{
|
||||
"cache_store": cfg.StatCache.Store,
|
||||
"cache_nodes": cfg.StatCache.Nodes,
|
||||
"cache_database": cfg.StatCache.Database,
|
||||
"cache_ttl": cfg.StatCache.TTL / time.Second,
|
||||
"cache_size": cfg.StatCache.Size,
|
||||
"cache_store": cfg.StatCache.Store,
|
||||
"cache_nodes": cfg.StatCache.Nodes,
|
||||
"cache_database": cfg.StatCache.Database,
|
||||
"cache_ttl": cfg.StatCache.TTL,
|
||||
"cache_size": cfg.StatCache.Size,
|
||||
"cache_disable_persistence": cfg.StatCache.DisablePersistence,
|
||||
},
|
||||
"filemetadatacache": map[string]interface{}{
|
||||
"cache_store": cfg.FilemetadataCache.Store,
|
||||
"cache_nodes": cfg.FilemetadataCache.Nodes,
|
||||
"cache_database": cfg.FilemetadataCache.Database,
|
||||
"cache_ttl": cfg.FilemetadataCache.TTL / time.Second,
|
||||
"cache_size": cfg.FilemetadataCache.Size,
|
||||
"cache_store": cfg.FilemetadataCache.Store,
|
||||
"cache_nodes": cfg.FilemetadataCache.Nodes,
|
||||
"cache_database": cfg.FilemetadataCache.Database,
|
||||
"cache_ttl": cfg.FilemetadataCache.TTL,
|
||||
"cache_size": cfg.FilemetadataCache.Size,
|
||||
"cache_disable_persistence": cfg.FilemetadataCache.DisablePersistence,
|
||||
},
|
||||
"idcache": map[string]interface{}{
|
||||
"cache_store": cfg.IDCache.Store,
|
||||
"cache_nodes": cfg.IDCache.Nodes,
|
||||
"cache_database": cfg.IDCache.Database,
|
||||
"cache_ttl": cfg.IDCache.TTL / time.Second,
|
||||
"cache_size": cfg.IDCache.Size,
|
||||
"cache_store": cfg.IDCache.Store,
|
||||
"cache_nodes": cfg.IDCache.Nodes,
|
||||
"cache_database": cfg.IDCache.Database,
|
||||
"cache_ttl": cfg.IDCache.TTL,
|
||||
"cache_size": cfg.IDCache.Size,
|
||||
"cache_disable_persistence": cfg.IDCache.DisablePersistence,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -256,25 +260,28 @@ func S3NG(cfg *config.Config) map[string]interface{} {
|
||||
"max_concurrency": cfg.Drivers.S3NG.MaxConcurrency,
|
||||
"asyncfileuploads": cfg.Drivers.OCIS.AsyncUploads,
|
||||
"statcache": map[string]interface{}{
|
||||
"cache_store": cfg.StatCache.Store,
|
||||
"cache_nodes": cfg.StatCache.Nodes,
|
||||
"cache_database": cfg.StatCache.Database,
|
||||
"cache_ttl": cfg.StatCache.TTL / time.Second,
|
||||
"cache_size": cfg.StatCache.Size,
|
||||
"cache_store": cfg.StatCache.Store,
|
||||
"cache_nodes": cfg.StatCache.Nodes,
|
||||
"cache_database": cfg.StatCache.Database,
|
||||
"cache_ttl": cfg.StatCache.TTL,
|
||||
"cache_size": cfg.StatCache.Size,
|
||||
"cache_disable_persistence": cfg.StatCache.DisablePersistence,
|
||||
},
|
||||
"filemetadatacache": map[string]interface{}{
|
||||
"cache_store": cfg.FilemetadataCache.Store,
|
||||
"cache_nodes": cfg.FilemetadataCache.Nodes,
|
||||
"cache_database": cfg.FilemetadataCache.Database,
|
||||
"cache_ttl": cfg.FilemetadataCache.TTL / time.Second,
|
||||
"cache_size": cfg.FilemetadataCache.Size,
|
||||
"cache_store": cfg.FilemetadataCache.Store,
|
||||
"cache_nodes": cfg.FilemetadataCache.Nodes,
|
||||
"cache_database": cfg.FilemetadataCache.Database,
|
||||
"cache_ttl": cfg.FilemetadataCache.TTL,
|
||||
"cache_size": cfg.FilemetadataCache.Size,
|
||||
"cache_disable_persistence": cfg.FilemetadataCache.DisablePersistence,
|
||||
},
|
||||
"idcache": map[string]interface{}{
|
||||
"cache_store": cfg.IDCache.Store,
|
||||
"cache_nodes": cfg.IDCache.Nodes,
|
||||
"cache_database": cfg.IDCache.Database,
|
||||
"cache_ttl": cfg.IDCache.TTL / time.Second,
|
||||
"cache_size": cfg.IDCache.Size,
|
||||
"cache_store": cfg.IDCache.Store,
|
||||
"cache_nodes": cfg.IDCache.Nodes,
|
||||
"cache_database": cfg.IDCache.Database,
|
||||
"cache_ttl": cfg.IDCache.TTL,
|
||||
"cache_size": cfg.IDCache.Size,
|
||||
"cache_disable_persistence": cfg.IDCache.DisablePersistence,
|
||||
},
|
||||
"events": map[string]interface{}{
|
||||
"natsaddress": cfg.Events.Addr,
|
||||
@@ -318,25 +325,28 @@ func S3NGNoEvents(cfg *config.Config) map[string]interface{} {
|
||||
"max_concurrency": cfg.Drivers.S3NG.MaxConcurrency,
|
||||
"lock_cycle_duration_factor": cfg.Drivers.S3NG.LockCycleDurationFactor,
|
||||
"statcache": map[string]interface{}{
|
||||
"cache_store": cfg.StatCache.Store,
|
||||
"cache_nodes": cfg.StatCache.Nodes,
|
||||
"cache_database": cfg.StatCache.Database,
|
||||
"cache_ttl": cfg.StatCache.TTL / time.Second,
|
||||
"cache_size": cfg.StatCache.Size,
|
||||
"cache_store": cfg.StatCache.Store,
|
||||
"cache_nodes": cfg.StatCache.Nodes,
|
||||
"cache_database": cfg.StatCache.Database,
|
||||
"cache_ttl": cfg.StatCache.TTL,
|
||||
"cache_size": cfg.StatCache.Size,
|
||||
"cache_disable_persistence": cfg.StatCache.DisablePersistence,
|
||||
},
|
||||
"filemetadatacache": map[string]interface{}{
|
||||
"cache_store": cfg.FilemetadataCache.Store,
|
||||
"cache_nodes": cfg.FilemetadataCache.Nodes,
|
||||
"cache_database": cfg.FilemetadataCache.Database,
|
||||
"cache_ttl": cfg.FilemetadataCache.TTL / time.Second,
|
||||
"cache_size": cfg.FilemetadataCache.Size,
|
||||
"cache_store": cfg.FilemetadataCache.Store,
|
||||
"cache_nodes": cfg.FilemetadataCache.Nodes,
|
||||
"cache_database": cfg.FilemetadataCache.Database,
|
||||
"cache_ttl": cfg.FilemetadataCache.TTL,
|
||||
"cache_size": cfg.FilemetadataCache.Size,
|
||||
"cache_disable_persistence": cfg.FilemetadataCache.DisablePersistence,
|
||||
},
|
||||
"idcache": map[string]interface{}{
|
||||
"cache_store": cfg.IDCache.Store,
|
||||
"cache_nodes": cfg.IDCache.Nodes,
|
||||
"cache_database": cfg.IDCache.Database,
|
||||
"cache_ttl": cfg.IDCache.TTL / time.Second,
|
||||
"cache_size": cfg.IDCache.Size,
|
||||
"cache_store": cfg.IDCache.Store,
|
||||
"cache_nodes": cfg.IDCache.Nodes,
|
||||
"cache_database": cfg.IDCache.Database,
|
||||
"cache_ttl": cfg.IDCache.TTL,
|
||||
"cache_size": cfg.IDCache.Size,
|
||||
"cache_disable_persistence": cfg.IDCache.DisablePersistence,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user