Index: common/gcloud/pubsub/subscriber/subscriber.go |
diff --git a/common/gcloud/pubsub/subscriber/subscriber.go b/common/gcloud/pubsub/subscriber/subscriber.go |
index 53300d8594ceb362a786edaf8bfdb0e3869dcb76..bdefe9d11238e5287ca5eb74da5787187b765f70 100644 |
--- a/common/gcloud/pubsub/subscriber/subscriber.go |
+++ b/common/gcloud/pubsub/subscriber/subscriber.go |
@@ -164,18 +164,5 @@ func (s *Subscriber) noDataSleep(c context.Context) { |
if d <= 0 { |
d = DefaultNoDataDelay |
} |
- cancellableSleep(c, d) |
-} |
- |
-// cancellableSleep sleeps, returning either when the sleep duration has expired |
-// or the supplied context has been canceled. |
-func cancellableSleep(c context.Context, delay time.Duration) { |
- // Sleep for "delay", stopping early if our Context is canceled. |
- select { |
- case <-clock.After(c, delay): |
- break |
- |
- case <-c.Done(): |
- break |
- } |
+ clock.Sleep(c, d) |
} |