mirror of https://github.com/restic/restic.git
repository functions:
repo/repository.go: print limit reached message once, remove unneedef function IsRepositoryLimitActive() restic/repository.go: remove unnneded interface definition
This commit is contained in:
parent
09fb254134
commit
5ae0914b26
|
@ -405,8 +405,10 @@ func (r *Repository) saveAndEncrypt(ctx context.Context, t restic.BlobType, data
|
|||
if r.opts.RepoSizeMax > 0 {
|
||||
r.opts.repoCurSize += uint64(length)
|
||||
if r.opts.repoCurSize > r.opts.RepoSizeMax {
|
||||
r.MaxRepoCapReached = true
|
||||
debug.Log("MaxCapacityExceeded")
|
||||
if !r.MaxRepoCapReached {
|
||||
debug.Log("MaxCapacityExceeded")
|
||||
r.MaxRepoCapReached = true
|
||||
}
|
||||
return length, errors.New("MaxCapacityExceeded")
|
||||
}
|
||||
}
|
||||
|
@ -441,14 +443,9 @@ func (r *Repository) MaxCapacityExceeded() bool {
|
|||
return r.MaxRepoCapReached
|
||||
}
|
||||
|
||||
func (r *Repository) IsRepositoryLimitActive() bool {
|
||||
return r.opts.RepoSizeMax > 0
|
||||
}
|
||||
|
||||
// CapacityChecker has to satisfy restic.Repository interface needs
|
||||
type CapacityChecker interface {
|
||||
MaxCapacityExceeded() bool
|
||||
IsRepositoryLimitActive() bool
|
||||
}
|
||||
|
||||
func (r *Repository) verifyCiphertext(buf []byte, uncompressedLength int, id restic.ID) error {
|
||||
|
|
|
@ -66,8 +66,6 @@ type Repository interface {
|
|||
|
||||
// MaxCapacityExceeded checks if repository capacity has been exceeded
|
||||
MaxCapacityExceeded() bool
|
||||
// IsRepositoryLimitActive checks if maximum repository size monitoring is active
|
||||
IsRepositoryLimitActive() bool
|
||||
}
|
||||
|
||||
type FileType = backend.FileType
|
||||
|
|
Loading…
Reference in New Issue