rclone/lib
Martin Czygan 5de9278650
fs/cache: make sure we call the Shutdown method on backends
This change ensures we call the Shutdown method on backends when
they drop out of the fs/cache and at program exit.

Some backends implement the optional fs.Shutdowner interface. Until now,
Shutdown is only checked and called, when a backend is wrapped (e.g.
crypt, compress, ...).

To have a general way to perform operations at the end of the backend
lifecycle with proper error handling, we can call Shutdown at cache
clear time.

We add a finalize hook to the cache which will be called when values
drop out of the cache.

Previous discussion: https://forum.rclone.org/t/31336
2022-06-28 12:51:59 +01:00
..
atexit build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
bucket docs: improve grammar and fix typos (#5361) 2021-11-04 12:50:43 +01:00
buildinfo version: report correct friendly-name for windows 10/11 versions after 2004 2022-01-24 21:27:42 +01:00
cache fs/cache: make sure we call the Shutdown method on backends 2022-06-28 12:51:59 +01:00
daemonize Remove github.com/pkg/errors and replace with std library version 2021-11-07 11:53:30 +00:00
dircache Remove github.com/pkg/errors and replace with std library version 2021-11-07 11:53:30 +00:00
encoder Fix lint issues reported by staticcheck 2022-06-13 21:13:50 +02:00
env docs: punctuation cleanup 2021-10-20 22:56:19 +02:00
errors Remove github.com/pkg/errors and replace with std library version 2021-11-07 11:53:30 +00:00
exitcode cmd: Move exit status codes to separate package 2021-07-07 17:59:26 +01:00
file test: use T.TempDir to create temporary test directory 2022-02-01 11:47:04 +00:00
http Error strings should not be capitalized 2022-06-23 23:26:02 +02:00
israce build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
jwtutil Error strings should not be capitalized 2022-06-23 23:26:02 +02:00
kv Fix lint issues reported by staticcheck 2022-06-13 21:13:50 +02:00
mmap Remove github.com/pkg/errors and replace with std library version 2021-11-07 11:53:30 +00:00
oauthutil Fix lint issues reported by staticcheck 2022-06-13 21:13:50 +02:00
pacer Fix lint issues reported by staticcheck 2022-06-13 21:13:50 +02:00
plugin build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
pool test: Don't run unreliable tests on CI #4171 2020-06-15 21:34:37 +01:00
random Remove github.com/pkg/errors and replace with std library version 2021-11-07 11:53:30 +00:00
ranges Spelling fixes 2020-10-14 15:21:31 +01:00
readers lib/readers: add FakeSeeker to adapt io.Reader to io.ReadSeeker #5422 2022-05-12 08:49:20 +01:00
rest Error strings should not be capitalized 2022-06-23 23:26:02 +02:00
structs docs: improve grammar and fix typos (#5361) 2021-11-04 12:50:43 +01:00
terminal fs/config, lib/terminal: use golang.org/x/term 2022-04-01 12:48:18 +01:00
version Fix lint issues reported by staticcheck 2022-06-13 21:13:50 +02:00