mirror of
https://github.com/navidrome/navidrome.git
synced 2026-04-03 06:41:01 +00:00
add trace message for plugin recompiles
Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
parent
18723c6aa8
commit
a05fddbf7d
@ -236,11 +236,11 @@ The output is optional on success. On error, return:
|
||||
|
||||
To schedule tasks, plugins call these host functions (provided by Navidrome):
|
||||
|
||||
| Host Function | Parameters | Description |
|
||||
|------------------------------|-----------------------------------------------|------------------------------------------|
|
||||
| `scheduler_scheduleonetime` | `delay_seconds, payload, schedule_id` | Schedule a one-time callback |
|
||||
| `scheduler_schedulerecurring`| `cron_expression, payload, schedule_id` | Schedule a recurring callback |
|
||||
| `scheduler_cancelschedule` | `schedule_id` | Cancel a scheduled task |
|
||||
| Host Function | Parameters | Description |
|
||||
|-------------------------------|-----------------------------------------|-------------------------------|
|
||||
| `scheduler_scheduleonetime` | `delay_seconds, payload, schedule_id` | Schedule a one-time callback |
|
||||
| `scheduler_schedulerecurring` | `cron_expression, payload, schedule_id` | Schedule a recurring callback |
|
||||
| `scheduler_cancelschedule` | `schedule_id` | Cancel a scheduled task |
|
||||
|
||||
#### Manifest Permissions
|
||||
|
||||
|
||||
@ -491,11 +491,13 @@ func (m *Manager) loadPlugin(name, wasmPath string) error {
|
||||
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
|
||||
|
||||
// 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 {
|
||||
log.Trace(m.ctx, "Recompiling plugin", "plugin", name)
|
||||
compiled.Close(m.ctx)
|
||||
compiled, err = extism.NewCompiledPlugin(m.ctx, pluginManifest, extismConfig, hostFunctions)
|
||||
if err != nil {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user