From 1d42a343d25b4ae6263fe2046c681f54ebee53dc Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 1 Mar 2017 07:57:10 +0000 Subject: [PATCH] b2: fix inconsistent listings and rclone check This was caused by re-using a variable for the results of a JSON unmarshal and the unmarshaller picking up existing entries. See https://forum.rclone.org/t/check-command-gives-unreliable-results/ --- b2/b2.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2/b2.go b/b2/b2.go index 5fa669973..6fd1198ba 100644 --- a/b2/b2.go +++ b/b2/b2.go @@ -467,7 +467,6 @@ func (f *Fs) list(dir string, level int, prefix string, limit int, hidden bool, if prefix != "" { request.StartFileName = prefix } - var response api.ListFileNamesResponse opts := rest.Opts{ Method: "POST", Path: "/b2_list_file_names", @@ -476,6 +475,7 @@ func (f *Fs) list(dir string, level int, prefix string, limit int, hidden bool, opts.Path = "/b2_list_file_versions" } for { + var response api.ListFileNamesResponse err := f.pacer.Call(func() (bool, error) { resp, err := f.srv.CallJSON(&opts, &request, &response) return f.shouldRetry(resp, err)