mirror of
https://github.com/restic/rest-server.git
synced 2025-12-06 17:15:45 -08: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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user