mirror of https://github.com/restic/restic.git
repository/repository - protect r.maxRepoCapReached
by Lock() in MaxCapacityExceeded()
This commit is contained in:
parent
d794e41252
commit
48510f920b
|
@ -436,6 +436,8 @@ func (r *Repository) CurrentRepositorySize(ctx context.Context) (uint64, error)
|
||||||
|
|
||||||
// MaxCapacityExceeded reports if repository has a limit and if it is exceeded
|
// MaxCapacityExceeded reports if repository has a limit and if it is exceeded
|
||||||
func (r *Repository) MaxCapacityExceeded() bool {
|
func (r *Repository) MaxCapacityExceeded() bool {
|
||||||
|
r.maxRepoMutex.Lock()
|
||||||
|
defer r.maxRepoMutex.Unlock()
|
||||||
if r.opts.RepoSizeMax == 0 {
|
if r.opts.RepoSizeMax == 0 {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue