Преглед на файлове

fix: avoid creating folders

Yeuoly преди 8 месеца
родител
ревизия
2952e15973
променени са 3 файла, в които са добавени 0 реда и са изтрити 15 реда
  1. 0 8
      internal/core/plugin_manager/manager.go
  2. 0 6
      internal/types/app/config.go
  3. 0 1
      internal/types/app/default.go

+ 0 - 8
internal/core/plugin_manager/manager.go

@@ -4,7 +4,6 @@ import (
 	"errors"
 	"errors"
 	"fmt"
 	"fmt"
 	"os"
 	"os"
-	"path/filepath"
 
 
 	"github.com/langgenius/dify-plugin-daemon/internal/core/dify_invocation"
 	"github.com/langgenius/dify-plugin-daemon/internal/core/dify_invocation"
 	"github.com/langgenius/dify-plugin-daemon/internal/core/dify_invocation/real"
 	"github.com/langgenius/dify-plugin-daemon/internal/core/dify_invocation/real"
@@ -91,13 +90,6 @@ func InitGlobalManager(oss oss.OSS, configuration *app.Config) *PluginManager {
 		pythonInterpreterPath:    configuration.PythonInterpreterPath,
 		pythonInterpreterPath:    configuration.PythonInterpreterPath,
 	}
 	}
 
 
-	// mkdir
-	os.MkdirAll(configuration.PluginWorkingPath, 0755)
-	os.MkdirAll(configuration.PluginInstalledPath, 0755)
-	os.MkdirAll(configuration.PluginMediaCachePath, 0755)
-	os.MkdirAll(configuration.PluginPackageCachePath, 0755)
-	os.MkdirAll(filepath.Dir(configuration.ProcessCachingPath), 0755)
-
 	return manager
 	return manager
 }
 }
 
 

+ 0 - 6
internal/types/app/config.go

@@ -39,8 +39,6 @@ type Config struct {
 	PluginInstalledPath    string `envconfig:"PLUGIN_INSTALLED_PATH" validate:"required"` // where the plugin finally installed
 	PluginInstalledPath    string `envconfig:"PLUGIN_INSTALLED_PATH" validate:"required"` // where the plugin finally installed
 	PluginPackageCachePath string `envconfig:"PLUGIN_PACKAGE_CACHE_PATH"`                 // where plugin packages stored
 	PluginPackageCachePath string `envconfig:"PLUGIN_PACKAGE_CACHE_PATH"`                 // where plugin packages stored
 
 
-	ProcessCachingPath string `envconfig:"PROCESS_CACHING_PATH"`
-
 	PluginMaxExecutionTimeout int `envconfig:"PLUGIN_MAX_EXECUTION_TIMEOUT" validate:"required"`
 	PluginMaxExecutionTimeout int `envconfig:"PLUGIN_MAX_EXECUTION_TIMEOUT" validate:"required"`
 
 
 	// platform like local or aws lambda
 	// platform like local or aws lambda
@@ -124,10 +122,6 @@ func (c *Config) Validate() error {
 		if c.PluginWorkingPath == "" {
 		if c.PluginWorkingPath == "" {
 			return fmt.Errorf("plugin working path is empty")
 			return fmt.Errorf("plugin working path is empty")
 		}
 		}
-
-		if c.ProcessCachingPath == "" {
-			return fmt.Errorf("process caching path is empty")
-		}
 	} else {
 	} else {
 		return fmt.Errorf("invalid platform")
 		return fmt.Errorf("invalid platform")
 	}
 	}

+ 0 - 1
internal/types/app/default.go

@@ -25,7 +25,6 @@ func (config *Config) SetDefault() {
 	setDefaultString(&config.PluginMediaCachePath, "./assets")
 	setDefaultString(&config.PluginMediaCachePath, "./assets")
 	setDefaultString(&config.PersistenceStoragePath, "./persistence")
 	setDefaultString(&config.PersistenceStoragePath, "./persistence")
 	setDefaultInt(&config.PersistenceStorageMaxSize, 100*1024*1024)
 	setDefaultInt(&config.PersistenceStorageMaxSize, 100*1024*1024)
-	setDefaultString(&config.ProcessCachingPath, "./subprocesses")
 	setDefaultString(&config.PluginPackageCachePath, "./plugin_packages")
 	setDefaultString(&config.PluginPackageCachePath, "./plugin_packages")
 	setDefaultString(&config.PythonInterpreterPath, "/usr/bin/python3")
 	setDefaultString(&config.PythonInterpreterPath, "/usr/bin/python3")
 }
 }