Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Unified Diff: client/internal/logdog/butler/output/retry.go

Issue 1211053004: LogDog: Add Butler Output package. (Closed) Base URL: https://github.com/luci/luci-go@logdog-review-streamserver
Patch Set: Added some doc.go's. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: client/internal/logdog/butler/output/retry.go
diff --git a/client/internal/logdog/butler/output/retry.go b/client/internal/logdog/butler/output/retry.go
new file mode 100644
index 0000000000000000000000000000000000000000..c85cb6d794c9730bab84a4503c3972e43b170e2a
--- /dev/null
+++ b/client/internal/logdog/butler/output/retry.go
@@ -0,0 +1,26 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package output
+
+import (
+ "time"
+
+ "github.com/luci/luci-go/common/retry"
+ "golang.org/x/net/context"
+)
+
+// DefaultRetryIterator returns a retry.Iterator configured with a default
+// exponential backoff retry configuration.
+func DefaultRetryIterator(context.Context) retry.Iterator {
+ // TODO: Tune backoff parameters.
estaab 2015/11/19 23:57:24 Should we allow any of these to be controlled by f
dnj 2015/11/20 01:55:12 I originally had this. Then I read a ToTT on flag
+ return &retry.ExponentialBackoff{
+ Limited: retry.Limited{
+ Delay: (500 * time.Millisecond),
+ Retries: 4,
+ MaxTotal: 20 * time.Second,
+ },
+ Multiplier: 2.0,
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698