mirror of
https://github.com/restic/restic.git
synced 2025-12-03 21:21:47 +00:00
backend: pass context into every backend constructor
This commit is contained in:
@@ -117,7 +117,7 @@ func open(cfg Config, rt http.RoundTripper) (*Backend, error) {
|
||||
}
|
||||
|
||||
// Open opens the gs backend at the specified bucket.
|
||||
func Open(cfg Config, rt http.RoundTripper) (restic.Backend, error) {
|
||||
func Open(_ context.Context, cfg Config, rt http.RoundTripper) (restic.Backend, error) {
|
||||
return open(cfg, rt)
|
||||
}
|
||||
|
||||
|
||||
@@ -58,12 +58,12 @@ func newGSTestSuite(t testing.TB) *test.Suite[gs.Config] {
|
||||
|
||||
// OpenFn is a function that opens a previously created temporary repository.
|
||||
Open: func(cfg gs.Config) (restic.Backend, error) {
|
||||
return gs.Open(cfg, tr)
|
||||
return gs.Open(context.TODO(), cfg, tr)
|
||||
},
|
||||
|
||||
// CleanupFn removes data created during the tests.
|
||||
Cleanup: func(cfg gs.Config) error {
|
||||
be, err := gs.Open(cfg, tr)
|
||||
be, err := gs.Open(context.TODO(), cfg, tr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user