diff options
author | Valery Piashchynski <[email protected]> | 2021-08-31 13:05:15 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-08-31 13:05:15 +0300 |
commit | 2f44878a7eac71d7b81e66246b46c615a95892d7 (patch) | |
tree | dca0f488614dc7e366aeec6face7296d9c52d2bf /plugins/boltdb | |
parent | 3a187237282444f70b1eae8881f08cb6f0e068fc (diff) |
Tune listener timers
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/boltdb')
-rw-r--r-- | plugins/boltdb/boltjobs/listener.go | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/plugins/boltdb/boltjobs/listener.go b/plugins/boltdb/boltjobs/listener.go index 39de34ab..7c161555 100644 --- a/plugins/boltdb/boltjobs/listener.go +++ b/plugins/boltdb/boltjobs/listener.go @@ -3,7 +3,6 @@ package boltjobs import ( "bytes" "encoding/gob" - "sync/atomic" "time" "github.com/spiral/roadrunner/v2/utils" @@ -11,7 +10,7 @@ import ( ) func (c *consumer) listener() { - tt := time.NewTicker(time.Millisecond * 10) + tt := time.NewTicker(time.Millisecond) defer tt.Stop() for { select { @@ -19,11 +18,6 @@ func (c *consumer) listener() { c.log.Info("boltdb listener stopped") return case <-tt.C: - if atomic.LoadUint64(c.active) >= uint64(c.prefetch) { - time.Sleep(time.Second) - continue - } - tx, err := c.db.Begin(true) if err != nil { c.log.Error("failed to begin writable transaction, job will be read on the next attempt", "error", err) @@ -78,7 +72,7 @@ func (c *consumer) listener() { } func (c *consumer) delayedJobsListener() { - tt := time.NewTicker(time.Millisecond * 10) + tt := time.NewTicker(time.Second) defer tt.Stop() // just some 90's |