Skip to content

Commit 918ce6f

Browse files
authored
fix : Plugin table missing for existing PLUGIN_INSTALLED_PATH (#748)
* fix : Plugin table missing for existing PLUGIN_INSTALLED_PATH * fix : Fix code review issues
1 parent 827d1ce commit 918ce6f

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

internal/core/control_panel/server_local.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import (
66
"time"
77

88
"github.com/langgenius/dify-plugin-daemon/internal/core/local_runtime"
9+
"github.com/langgenius/dify-plugin-daemon/internal/db"
10+
"github.com/langgenius/dify-plugin-daemon/internal/types/models"
911
"github.com/langgenius/dify-plugin-daemon/pkg/entities/plugin_entities"
1012
routinepkg "github.com/langgenius/dify-plugin-daemon/pkg/routine"
1113
"github.com/langgenius/dify-plugin-daemon/pkg/utils/log"
@@ -72,6 +74,20 @@ func (c *ControlPanel) handleNewLocalPlugins() {
7274
continue
7375
}
7476

77+
// ckeck plugin db data exists
78+
_, err = db.GetOne[models.Plugin](
79+
db.Equal("plugin_unique_identifier", uniquePluginIdentifier.String()),
80+
)
81+
82+
if err != nil {
83+
if err == db.ErrDatabaseNotFound {
84+
log.Info("Plugin table missing for existing PLUGIN_INSTALLED_PATH", "plugin_unique_identifier", uniquePluginIdentifier.String())
85+
} else {
86+
log.Error("failed to query plugin from database", "plugin_unique_identifier", uniquePluginIdentifier.String(), "error", err)
87+
}
88+
continue
89+
}
90+
7591
// skip if the plugin is already launched
7692
if c.localPluginRuntimes.Exists(uniquePluginIdentifier) {
7793
continue

0 commit comments

Comments
 (0)