mirror of
https://github.com/pgsty/minio.git
synced 2026-07-19 04:00:25 +03:00
Add an option to make bucket notifications synchronous (#17406)
With the current asynchronous behaviour in sending notification events to the targets, we can't provide guaranteed delivery as the systems might go for restarts. For such event-driven use-cases, we can provide an option to enable synchronous events where the APIs wait until the event is successfully sent or persisted. This commit adds 'MINIO_API_SYNC_EVENTS' env which when set to 'on' will enable sending/persisting events to targets synchronously.
This commit is contained in:
@@ -52,6 +52,7 @@ type apiConfig struct {
|
||||
disableODirect bool
|
||||
gzipObjects bool
|
||||
rootAccess bool
|
||||
syncEvents bool
|
||||
}
|
||||
|
||||
const cgroupLimitFile = "/sys/fs/cgroup/memory/memory.limit_in_bytes"
|
||||
@@ -166,6 +167,7 @@ func (t *apiConfig) init(cfg api.Config, setDriveCounts []int) {
|
||||
t.disableODirect = cfg.DisableODirect
|
||||
t.gzipObjects = cfg.GzipObjects
|
||||
t.rootAccess = cfg.RootAccess
|
||||
t.syncEvents = cfg.SyncEvents
|
||||
}
|
||||
|
||||
func (t *apiConfig) isDisableODirect() bool {
|
||||
@@ -353,3 +355,10 @@ func (t *apiConfig) getTransitionWorkers() int {
|
||||
|
||||
return t.transitionWorkers
|
||||
}
|
||||
|
||||
func (t *apiConfig) isSyncEventsEnabled() bool {
|
||||
t.mu.RLock()
|
||||
defer t.mu.RUnlock()
|
||||
|
||||
return t.syncEvents
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user