Enable persistent event store in elasticsearch (#7564)

This commit is contained in:
Praveen raj Mani
2019-07-12 08:23:20 +05:30
committed by Nitish Tiwari
parent 2337e5f803
commit bba562235b
13 changed files with 164 additions and 45 deletions
+12 -4
View File
@@ -25,6 +25,7 @@ import (
"sync"
"github.com/minio/minio/pkg/event"
"github.com/minio/minio/pkg/sys"
)
const (
@@ -36,15 +37,22 @@ const (
type QueueStore struct {
sync.RWMutex
directory string
eC uint16
limit uint16
eC uint64
limit uint64
}
// NewQueueStore - Creates an instance for QueueStore.
func NewQueueStore(directory string, limit uint16) *QueueStore {
func NewQueueStore(directory string, limit uint64) *QueueStore {
if limit == 0 {
limit = maxLimit
currRlimit, _, err := sys.GetMaxOpenFileLimit()
if err == nil {
if currRlimit > limit {
limit = currRlimit
}
}
}
queueStore := &QueueStore{
directory: directory,
limit: limit,
@@ -61,7 +69,7 @@ func (store *QueueStore) Open() error {
return terr
}
eCount := uint16(len(store.list()))
eCount := uint64(len(store.list()))
if eCount >= store.limit {
return errLimitExceeded
}