From 14e93bfd8a7ee0f394bea73a4719c8aa37ce6808 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 2 Nov 2019 10:16:58 +0000 Subject: [PATCH] rest: call the Signer with the mutex unlocked This enables the signer to adjust rest parameters and call rest again if necessary. --- lib/rest/rest.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/rest/rest.go b/lib/rest/rest.go index e4cd74cef..92edc64fe 100644 --- a/lib/rest/rest.go +++ b/lib/rest/rest.go @@ -269,7 +269,9 @@ func (api *Client) Call(ctx context.Context, opts *Opts) (resp *http.Response, e c = api.c } if api.signer != nil { + api.mu.RUnlock() err = api.signer(req) + api.mu.RLock() if err != nil { return nil, errors.Wrap(err, "signer failed") }