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:
MickaelK
2026-05-09 00:04:41 +10:00
parent 3c774957ab
commit 516e964fa9
+3 -3
View File
@@ -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)