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

Unified Diff: server/settings/settings.go

Issue 2951393002: [errors] de-specialize Transient in favor of Tags. (Closed)
Patch Set: more refactor Created 3 years, 6 months 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: server/settings/settings.go
diff --git a/server/settings/settings.go b/server/settings/settings.go
index c21c0f97681fcf84b427165b7a452f835c50c8b4..c217afeda105f20354a5343eedd0094d435c8fcc 100644
--- a/server/settings/settings.go
+++ b/server/settings/settings.go
@@ -23,6 +23,7 @@ import (
"github.com/luci/luci-go/common/data/caching/lazyslot"
"github.com/luci/luci-go/common/logging"
"github.com/luci/luci-go/common/retry"
+ "github.com/luci/luci-go/common/retry/transient"
)
var (
@@ -131,7 +132,7 @@ func New(storage Storage) *Settings {
values: lazyslot.Slot{
Timeout: 15 * time.Second, // retry for 15 sec at most
Fetcher: func(c context.Context, _ lazyslot.Value) (result lazyslot.Value, err error) {
- err = retry.Retry(c, retry.TransientOnly(retry.Default), func() error {
+ err = retry.Retry(c, transient.Only(retry.Default), func() error {
ctx, _ := clock.WithTimeout(c, 2*time.Second) // trigger a retry after 2 sec RPC timeout
result, err = attemptToFetchSettings(ctx, storage)
return err

Powered by Google App Engine
This is Rietveld 408576698