mirror of
https://github.com/restic/restic.git
synced 2025-10-09 07:33:53 +00:00
local/sftp: move limiter setup into backend
This commit is contained in:
@@ -31,11 +31,7 @@ type Local struct {
|
||||
var _ restic.Backend = &Local{}
|
||||
|
||||
func NewFactory() location.Factory {
|
||||
return location.NewLimitedBackendFactory(ParseConfig, location.NoPassword, func(ctx context.Context, cfg Config, _ limiter.Limiter) (*Local, error) {
|
||||
return Create(ctx, cfg)
|
||||
}, func(ctx context.Context, cfg Config, _ limiter.Limiter) (*Local, error) {
|
||||
return Open(ctx, cfg)
|
||||
})
|
||||
return location.NewLimitedBackendFactory(ParseConfig, location.NoPassword, limiter.WrapBackendConstructor(Create), limiter.WrapBackendConstructor(Open))
|
||||
}
|
||||
|
||||
const defaultLayout = "default"
|
||||
|
Reference in New Issue
Block a user