forked from TrueCloudLab/distribution
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
1 changed files with 2 additions and 1 deletions
|
@ -134,11 +134,12 @@ func (ttles *TTLExpirationScheduler) Start() error {
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-ttles.saveTimer.C:
|
case <-ttles.saveTimer.C:
|
||||||
|
ttles.Lock()
|
||||||
if !ttles.indexDirty {
|
if !ttles.indexDirty {
|
||||||
|
ttles.Unlock()
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
ttles.Lock()
|
|
||||||
err := ttles.writeState()
|
err := ttles.writeState()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
context.GetLogger(ttles.ctx).Errorf("Error writing scheduler state: %s", err)
|
context.GetLogger(ttles.ctx).Errorf("Error writing scheduler state: %s", err)
|
||||||
|
|
Loading…
Reference in a new issue