Fix access race in proxy scheduler
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This commit is contained in:
parent
798b7331ca
commit
dabdc5e52b
@ -134,11 +134,12 @@ func (ttles *TTLExpirationScheduler) Start() error {
|
||||
for {
|
||||
select {
|
||||
case <-ttles.saveTimer.C:
|
||||
ttles.Lock()
|
||||
if !ttles.indexDirty {
|
||||
ttles.Unlock()
|
||||
continue
|
||||
}
|
||||
|
||||
ttles.Lock()
|
||||
err := ttles.writeState()
|
||||
if err != nil {
|
||||
context.GetLogger(ttles.ctx).Errorf("Error writing scheduler state: %s", err)
|
||||
|
Loading…
Reference in New Issue
Block a user