mirror of
https://github.com/langgenius/dify-plugin-daemon.git
synced 2026-07-23 10:15:22 -04:00
1c9e28bc75
* replace internal oss with dify-cloud-kit * remove validate * fix tests * fix tests
26 lines
545 B
Go
26 lines
545 B
Go
package persistence
|
|
|
|
import (
|
|
"github.com/langgenius/dify-cloud-kit/oss"
|
|
|
|
"github.com/langgenius/dify-plugin-daemon/internal/types/app"
|
|
"github.com/langgenius/dify-plugin-daemon/internal/utils/log"
|
|
)
|
|
|
|
var (
|
|
persistence *Persistence
|
|
)
|
|
|
|
func InitPersistence(oss oss.OSS, config *app.Config) {
|
|
persistence = &Persistence{
|
|
storage: NewWrapper(oss, config.PersistenceStoragePath),
|
|
maxStorageSize: config.PersistenceStorageMaxSize,
|
|
}
|
|
|
|
log.Info("Persistence initialized")
|
|
}
|
|
|
|
func GetPersistence() *Persistence {
|
|
return persistence
|
|
}
|