Skip to content

Commit 700a257

Browse files
tamilmani1989sharmasushant
authored andcommitted
Fix wait timeout issue for getting file lock (#193)
* fixed a potential timeout issue for getting file lock
1 parent 9f93ec6 commit 700a257

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

store/json.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const (
2424
lockMaxRetries = 20
2525

2626
// Delay between lock retries.
27-
lockRetryDelay = 100 * time.Millisecond
27+
lockRetryDelayInMilliseconds = 100
2828
)
2929

3030
// jsonFileStore is an implementation of KeyValueStore using a local JSON file.
@@ -157,7 +157,7 @@ func (kvs *jsonFileStore) Lock(block bool) error {
157157
return ErrStoreLocked
158158
}
159159

160-
time.Sleep(lockRetryDelay)
160+
time.Sleep(time.Duration(lockRetryDelayInMilliseconds) * time.Millisecond)
161161
}
162162

163163
// Write the process ID for easy identification.

0 commit comments

Comments
 (0)