lib/db: Don't put truncated files (ref #6855, ref #6501) (#6888)

This commit is contained in:
Simon Frei
2020-08-18 09:20:12 +02:00
committed by GitHub
parent 9c2117f08e
commit 8f5215878b
5 changed files with 158 additions and 25 deletions
+5 -4
View File
@@ -7,6 +7,7 @@
package backend
import (
"errors"
"os"
"strings"
"sync"
@@ -157,13 +158,13 @@ type errNotFound struct{}
func (*errNotFound) Error() string { return "key not found" }
func IsClosed(err error) bool {
_, ok := err.(*errClosed)
return ok
var e *errClosed
return errors.As(err, &e)
}
func IsNotFound(err error) bool {
_, ok := err.(*errNotFound)
return ok
var e *errNotFound
return errors.As(err, &e)
}
// releaser manages counting on top of a waitgroup