fix(plugins): clear plugin errors on startup to allow retrying
Plugins that entered an error state (e.g., incompatible with the Navidrome version) would remain in that state across restarts, blocking the user from retrying. This adds a ClearErrors method to PluginRepository that resets the last_error field on all plugins, and calls it during plugin manager startup before syncing and loading. Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
@@ -146,6 +146,12 @@ func (m *Manager) Start(ctx context.Context) error {
|
||||
|
||||
log.Info(ctx, "Starting plugin manager", "folder", folder)
|
||||
|
||||
// Clear previous error states so plugins can be retried on restart
|
||||
adminCtx := adminContext(ctx)
|
||||
if err := m.ds.Plugin(adminCtx).ClearErrors(); err != nil {
|
||||
log.Error(ctx, "Error clearing plugin errors", err)
|
||||
}
|
||||
|
||||
// Sync plugins folder with DB
|
||||
if err := m.syncPlugins(ctx, folder); err != nil {
|
||||
log.Error(ctx, "Error syncing plugins with DB", err)
|
||||
|
||||
Reference in New Issue
Block a user