diff --git a/.github/workflows/dependabot-automerge.yml b/.github/workflows/dependabot-automerge.yml index 7cf424bf..1aa679d9 100644 --- a/.github/workflows/dependabot-automerge.yml +++ b/.github/workflows/dependabot-automerge.yml @@ -15,7 +15,7 @@ jobs: steps: - name: metadata id: metadata - uses: dependabot/fetch-metadata@v1.3.1 + uses: dependabot/fetch-metadata@v1.3.3 with: github-token: "${{ secrets.TOKEN }}" - name: merge diff --git a/register/memory_test.go b/register/memory_test.go index 7c3ec0cd..faad102b 100644 --- a/register/memory_test.go +++ b/register/memory_test.go @@ -301,11 +301,11 @@ func TestWatcher(t *testing.T) { wg.Add(1) go func() { for { - ch, err := wc.Next() + _, err := wc.Next() if err != nil { t.Fatal("unexpected err", err) } - t.Logf("changes %#+v", ch.Service) + // t.Logf("changes %#+v", ch.Service) wc.Stop() wg.Done() return diff --git a/store/options.go b/store/options.go index 3fa6c79d..f8360e41 100644 --- a/store/options.go +++ b/store/options.go @@ -34,6 +34,8 @@ type Options struct { Addrs []string // Wrappers store wrapper that called before actual functions // Wrappers []Wrapper + // Timeout specifies timeout duration for all operations + Timeout time.Duration } // NewOptions creates options struct @@ -110,6 +112,13 @@ func Tracer(t tracer.Tracer) Option { } } +// Timeout sets the timeout +func Timeout(td time.Duration) Option { + return func(o *Options) { + o.Timeout = td + } +} + // Addrs contains the addresses or other connection information of the backing storage. // For example, an etcd implementation would contain the nodes of the cluster. // A SQL implementation could contain one or more connection strings.