mirror of
https://github.com/pgsty/minio.git
synced 2026-03-16 01:26:03 +01:00
allow dynamically changing max_object_versions per object (#19265)
This commit is contained in:
@@ -55,6 +55,7 @@ type apiConfig struct {
|
||||
gzipObjects bool
|
||||
rootAccess bool
|
||||
syncEvents bool
|
||||
objectMaxVersions int
|
||||
}
|
||||
|
||||
const (
|
||||
@@ -186,6 +187,7 @@ func (t *apiConfig) init(cfg api.Config, setDriveCounts []int) {
|
||||
t.gzipObjects = cfg.GzipObjects
|
||||
t.rootAccess = cfg.RootAccess
|
||||
t.syncEvents = cfg.SyncEvents
|
||||
t.objectMaxVersions = cfg.ObjectMaxVersions
|
||||
}
|
||||
|
||||
func (t *apiConfig) odirectEnabled() bool {
|
||||
@@ -386,3 +388,15 @@ func (t *apiConfig) isSyncEventsEnabled() bool {
|
||||
|
||||
return t.syncEvents
|
||||
}
|
||||
|
||||
func (t *apiConfig) getObjectMaxVersions() int {
|
||||
t.mu.RLock()
|
||||
defer t.mu.RUnlock()
|
||||
|
||||
if t.objectMaxVersions <= 0 {
|
||||
// defaults to 'maxObjectVersions' when unset.
|
||||
return maxObjectVersions
|
||||
}
|
||||
|
||||
return t.objectMaxVersions
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user