mirror of
https://github.com/navidrome/navidrome.git
synced 2026-08-31 07:30:32 +00:00
add trace message for plugin recompiles
Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
parent
b58493141c
commit
adbe10880d
@ -236,11 +236,11 @@ The output is optional on success. On error, return:
|
|||||||
|
|
||||||
To schedule tasks, plugins call these host functions (provided by Navidrome):
|
To schedule tasks, plugins call these host functions (provided by Navidrome):
|
||||||
|
|
||||||
| Host Function | Parameters | Description |
|
| Host Function | Parameters | Description |
|
||||||
|------------------------------|-----------------------------------------------|------------------------------------------|
|
|-------------------------------|-----------------------------------------|-------------------------------|
|
||||||
| `scheduler_scheduleonetime` | `delay_seconds, payload, schedule_id` | Schedule a one-time callback |
|
| `scheduler_scheduleonetime` | `delay_seconds, payload, schedule_id` | Schedule a one-time callback |
|
||||||
| `scheduler_schedulerecurring`| `cron_expression, payload, schedule_id` | Schedule a recurring callback |
|
| `scheduler_schedulerecurring` | `cron_expression, payload, schedule_id` | Schedule a recurring callback |
|
||||||
| `scheduler_cancelschedule` | `schedule_id` | Cancel a scheduled task |
|
| `scheduler_cancelschedule` | `schedule_id` | Cancel a scheduled task |
|
||||||
|
|
||||||
#### Manifest Permissions
|
#### Manifest Permissions
|
||||||
|
|
||||||
|
|||||||
@ -491,11 +491,13 @@ func (m *Manager) loadPlugin(name, wasmPath string) error {
|
|||||||
hostFunctions = append(hostFunctions, host.RegisterCacheHostFunctions(service)...)
|
hostFunctions = append(hostFunctions, host.RegisterCacheHostFunctions(service)...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if recompilation is needed (AllowedHosts or host functions)
|
// Check if the plugin needs to be recompiled with real host functions
|
||||||
needsRecompile := len(pluginManifest.AllowedHosts) > 0 || len(hostFunctions) > 0
|
needsRecompile := len(pluginManifest.AllowedHosts) > 0 || len(hostFunctions) > 0
|
||||||
|
|
||||||
// Recompile if needed
|
// Recompile if needed. It is actually not a "recompile" since the first compilation
|
||||||
|
// should be cached by wazero. We just need to do it this way to provide the real host functions.
|
||||||
if needsRecompile {
|
if needsRecompile {
|
||||||
|
log.Trace(m.ctx, "Recompiling plugin", "plugin", name)
|
||||||
compiled.Close(m.ctx)
|
compiled.Close(m.ctx)
|
||||||
compiled, err = extism.NewCompiledPlugin(m.ctx, pluginManifest, extismConfig, hostFunctions)
|
compiled, err = extism.NewCompiledPlugin(m.ctx, pluginManifest, extismConfig, hostFunctions)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user