mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2026-10-19 16:14:39 +00:00
fix (plg_backend_samba): caching issue when using vfs
When using vfs we'd have a cache miss, this fixes it
This commit is contained in:
@@ -38,9 +38,6 @@ type Samba struct {
|
||||
}
|
||||
|
||||
func (smb Samba) Init(params map[string]string, app *App) (IBackend, error) {
|
||||
if c := SambaCache.Get(params); c != nil {
|
||||
return c.(*Samba), nil
|
||||
}
|
||||
if strings.HasPrefix(params["host"], "smb://") == false {
|
||||
params["host"] = "smb://" + params["host"]
|
||||
}
|
||||
@@ -62,6 +59,9 @@ func (smb Samba) Init(params map[string]string, app *App) (IBackend, error) {
|
||||
if params["port"] == "" {
|
||||
params["port"] = "445"
|
||||
}
|
||||
if c := SambaCache.Get(params); c != nil {
|
||||
return c.(*Samba), nil
|
||||
}
|
||||
|
||||
host := fmt.Sprintf("%s:%s", params["host"], params["port"])
|
||||
conn, err := net.DialTimeout("tcp", host, 10*time.Second)
|
||||
|
||||
Reference in New Issue
Block a user