mirror of
https://github.com/restic/rest-server.git
synced 2025-10-19 07:33:21 +00:00
Remove fs package and dirty tricks it does
The Linux kernel page cache ALWAYS knows better. Fighting it brings only worse performance. Usage of fadvise() is wrong 9 out of 10 times. Removing the whole fs package brings a nice 100% speedup when running costly prune command. And that is measured on localhost, the improvement could be much bigger when using network with higher latency.
This commit is contained in:
parent
bbcbca2d4e
commit
267ae63276
6 changed files with 4 additions and 205 deletions
|
@ -30,8 +30,7 @@ import (
|
|||
"encoding/csv"
|
||||
"io"
|
||||
"log"
|
||||
|
||||
"github.com/zcalusic/restic-server/fs"
|
||||
"os"
|
||||
)
|
||||
|
||||
// Lookup passwords in a htpasswd file. The entries must have been created with -s for SHA encryption.
|
||||
|
@ -44,7 +43,7 @@ type HtpasswdFile struct {
|
|||
// NewHtpasswdFromFile reads the users and passwords from a htpasswd file and returns them. If an error is encountered,
|
||||
// it is returned, together with a nil-Pointer for the HtpasswdFile.
|
||||
func NewHtpasswdFromFile(path string) (*HtpasswdFile, error) {
|
||||
r, err := fs.Open(path)
|
||||
r, err := os.Open(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue