introduce 'mc admin config set alias/ api odirect=on' (#17753)

change disable_odirect=off -> odirect=on to make it
easier to understand, instead of making it double
negative.
This commit is contained in:
Harshavardhana
2023-07-31 00:12:53 -07:00
committed by GitHub
parent 5e5bdf5432
commit 73edd5b8fd
5 changed files with 36 additions and 28 deletions

View File

@@ -49,7 +49,7 @@ type apiConfig struct {
staleUploadsExpiry time.Duration
staleUploadsCleanupInterval time.Duration
deleteCleanupInterval time.Duration
disableODirect bool
enableODirect bool
gzipObjects bool
rootAccess bool
syncEvents bool
@@ -164,17 +164,17 @@ func (t *apiConfig) init(cfg api.Config, setDriveCounts []int) {
t.staleUploadsExpiry = cfg.StaleUploadsExpiry
t.staleUploadsCleanupInterval = cfg.StaleUploadsCleanupInterval
t.deleteCleanupInterval = cfg.DeleteCleanupInterval
t.disableODirect = cfg.DisableODirect
t.enableODirect = cfg.EnableODirect
t.gzipObjects = cfg.GzipObjects
t.rootAccess = cfg.RootAccess
t.syncEvents = cfg.SyncEvents
}
func (t *apiConfig) isDisableODirect() bool {
func (t *apiConfig) odirectEnabled() bool {
t.mu.RLock()
defer t.mu.RUnlock()
return t.disableODirect
return t.enableODirect
}
func (t *apiConfig) shouldGzipObjects() bool {