Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在开发环境下,无法通过配置 fixedPluginPath 添加新的插件 #2939

Closed
ruibaby opened this issue Dec 13, 2022 · 0 comments · Fixed by #2941
Closed

在开发环境下,无法通过配置 fixedPluginPath 添加新的插件 #2939

ruibaby opened this issue Dec 13, 2022 · 0 comments · Fixed by #2941
Labels
area/core Issues or PRs related to the Halo Core kind/bug Categorizes issue or PR as related to a bug.

Comments

@ruibaby
Copy link
Member

ruibaby commented Dec 13, 2022

是什么版本出现了此问题?

2.0.1

使用的什么数据库?

PostgreSQL

使用的哪种方式部署?

Docker Compose

在线站点地址

https://demo.halo.run

发生了什么?

配置如下:

halo:
  work-dir: ${user.home}/halo2-dev
  plugin:
    runtime-mode: development # development, deployment
    classes-directories:
      - "build/classes"
      - "build/resources"
    lib-directories:
      - "libs"
    fixedPluginPath:
      - "/Users/ryanwang/Workspace/github/ruibaby/halo-dev-plugins/plugin-migrate"
      - "/Users/ryanwang/Workspace/github/ruibaby/halo-dev-plugins/plugin-unsplash"
      - "/Users/ryanwang/Workspace/github/ruibaby/halo-dev-plugins/plugin-links"
      - "/Users/ryanwang/Workspace/github/ruibaby/halo-dev-plugins/plugin-sitemap"
      - "/Users/ryanwang/Workspace/github/ruibaby/halo-dev-plugins/plugin-comment-widget"
      - "/Users/ryanwang/Workspace/github/ruibaby/halo-dev-plugins/plugin-lightgallery"
      - "/Users/ryanwang/Workspace/github/ruibaby/halo-dev-plugins/plugin-highlightjs"
      - "/Users/ryanwang/Workspace/github/ruibaby/halo-dev-plugins/plugin-search-widget"
      - "/Users/ryanwang/Workspace/github/ruibaby/halo-dev-plugins/plugin-umami"
      - "/Users/ryanwang/Workspace/github/ruibaby/halo-dev-plugins/plugin-photos"
      - "/Users/ryanwang/Workspace/github/ruibaby/halo-dev-plugins/plugin-tui.editor"
      - "/Users/ryanwang/Workspace/github/ruibaby/halo-dev-plugins/plugin-live2d"

如上,后面三个为新加的插件,重启后无法加载成功,在 Console 列表没有展示:

image

清空数据库之后重启,可以加载成功:

image

/kind bug
/area core

相关日志输出

No response

附加信息

No response

@f2c-ci-robot f2c-ci-robot bot added kind/bug Categorizes issue or PR as related to a bug. area/core Issues or PRs related to the Halo Core labels Dec 13, 2022
f2c-ci-robot bot pushed a commit that referenced this issue Dec 14, 2022
…velopment mode (#2941)

#### What type of PR is this?
/kind bug
/area core

#### What this PR does / why we need it:
修复插件开发模式下后续增加的 fixedPluginPath 项无法被加载的问题
- 目前启动时会加载 pluginRepository 的所有 path,fixedPluginPath 被 DefaultDevelopmentPluginRepository 管理,所以在遍历 fixedPluginPath 加载时可能已经被加载过,需要判断是否被加载过,但即使被加载过也不能跳过而要继续执行创建/更新 plugin.yaml 资源的逻辑
- 创建/更新 plugin.yaml 时需要使用重试机制防止因为乐观锁冲突导致 Halo 无法启动

see #2939 for more detail
#### Which issue(s) this PR fixes:

Fixes #2939

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
修复插件开发模式下后续增加的 fixedPluginPath 项无法被加载的问题
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core Issues or PRs related to the Halo Core kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant