forked from TrueCloudLab/frostfs-node
[#1818] writecache: Increase error counter on background errors
Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
parent
bffb0f894c
commit
777fd32d4f
7 changed files with 105 additions and 48 deletions
|
@ -52,6 +52,8 @@ type options struct {
|
|||
maxBatchDelay time.Duration
|
||||
// noSync is true iff FSTree allows unsynchronized writes.
|
||||
noSync bool
|
||||
// reportError is the function called when encountering disk errors in background workers.
|
||||
reportError func(string, error)
|
||||
}
|
||||
|
||||
// WithLogger sets logger.
|
||||
|
@ -142,3 +144,10 @@ func WithNoSync(noSync bool) Option {
|
|||
o.noSync = noSync
|
||||
}
|
||||
}
|
||||
|
||||
// WithReportErrorFunc sets error reporting function.
|
||||
func WithReportErrorFunc(f func(string, error)) Option {
|
||||
return func(o *options) {
|
||||
o.reportError = f
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue