forked from TrueCloudLab/restic
backend/sema: rename constructor to NewBackend
This commit is contained in:
parent
f27750e270
commit
ebba233a3a
2 changed files with 4 additions and 4 deletions
|
@ -746,7 +746,7 @@ func open(ctx context.Context, s string, gopts GlobalOptions, opts options.Optio
|
||||||
}
|
}
|
||||||
|
|
||||||
// wrap with debug logging and connection limiting
|
// wrap with debug logging and connection limiting
|
||||||
be = logger.New(sema.New(be))
|
be = logger.New(sema.NewBackend(be))
|
||||||
|
|
||||||
// wrap backend if a test specified an inner hook
|
// wrap backend if a test specified an inner hook
|
||||||
if gopts.backendInnerTestHook != nil {
|
if gopts.backendInnerTestHook != nil {
|
||||||
|
@ -821,5 +821,5 @@ func create(ctx context.Context, s string, opts options.Options) (restic.Backend
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return logger.New(sema.New(be)), nil
|
return logger.New(sema.NewBackend(be)), nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,8 +18,8 @@ type connectionLimitedBackend struct {
|
||||||
sem semaphore
|
sem semaphore
|
||||||
}
|
}
|
||||||
|
|
||||||
// New creates a backend that limits the concurrent operations on the underlying backend
|
// NewBackend creates a backend that limits the concurrent operations on the underlying backend
|
||||||
func New(be restic.Backend) restic.Backend {
|
func NewBackend(be restic.Backend) restic.Backend {
|
||||||
sem, err := newSemaphore(be.Connections())
|
sem, err := newSemaphore(be.Connections())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|
Loading…
Reference in a new issue