Index: appengine/memlock/memlock.go |
diff --git a/appengine/memlock/memlock.go b/appengine/memlock/memlock.go |
index b0f14f5c663f5b579f1f53989469ccdd6522799d..7eefeb0d0d1bc495bafc116ac2bfa754cc2c66d0 100644 |
--- a/appengine/memlock/memlock.go |
+++ b/appengine/memlock/memlock.go |
@@ -152,12 +152,9 @@ func TryWithLock(ctx context.Context, key, clientID string, f func(context.Conte |
close(finished) |
}() |
- checkLoop: |
for { |
- select { |
- case <-subCtx.Done(): |
- break checkLoop |
- case <-clock.Get(ctx).After(delay): |
+ if (<-clock.After(subCtx, delay)).Err != nil { |
+ break |
} |
if !checkAnd(refresh) { |
log.Warningf("lost lock: %s", err) |