diff --git a/apis/api_instance.md b/apis/api_instance.md index 64f2094..c197751 100644 --- a/apis/api_instance.md +++ b/apis/api_instance.md @@ -1109,6 +1109,13 @@ POST /api/exchange/request_buy_instance } ``` +Runtime behavior of `eventTask`: + +- `autoStart` runs once after the daemon finishes loading instances. The daemon waits about five seconds, then starts instances that have this flag enabled and are stopped. Changes made directly to the file are not hot-reloaded. +- `autoRestart` only starts an instance again after its process exits; restarting the daemon does not trigger it. +- `autoRestartMaxTimes` limits automatic restarts within the current daemon process. `-1` means unlimited. Once the limit is reached, later unexpected exits are not restarted automatically. +- Changes made through the API or panel update the in-memory instance and are persisted to the `InstanceConfig` file. Editing the file directly does not refresh an already-loaded instance, and a later daemon write can overwrite the manual change. + ## Type of InstanceDetail diff --git a/zh_cn/apis/api_instance.md b/zh_cn/apis/api_instance.md index 914f899..14f2ba9 100644 --- a/zh_cn/apis/api_instance.md +++ b/zh_cn/apis/api_instance.md @@ -1068,6 +1068,13 @@ POST /api/exchange/request_buy_instance } ``` +`eventTask` 字段的运行时行为: + +- `autoStart` 只在 daemon 完成实例加载后执行一次。daemon 会等待约 5 秒,然后启动配置为自动启动且当前已停止的实例;运行期间修改该字段不会热加载。 +- `autoRestart` 只在实例进程退出后触发重启,不会因为 daemon 重启而启动实例。 +- `autoRestartMaxTimes` 是当前 daemon 进程内的自动重启上限;`-1` 表示不限制。达到上限后,后续异常退出不会再自动启动。 +- 通过 API 或面板修改配置会立即更新内存中的实例配置并持久化到 `InstanceConfig` 文件。直接编辑文件不会刷新已加载的实例,daemon 后续写回配置时可能覆盖手工修改。 + ## InstanceDetail 类型