docs: document script hot-reload mechanisms for all script types
This commit is contained in:
@@ -209,6 +209,32 @@ When the Instance Actor is stopped (due to disable, delete, or redeployment), Ak
|
||||
|
||||
---
|
||||
|
||||
## Script Lifecycle
|
||||
|
||||
All script types can be updated without restarting the cluster, but the mechanism differs per type.
|
||||
|
||||
### Instance Scripts and Alarm On-Trigger Scripts
|
||||
|
||||
- Compiled at deployment time when the Deployment Manager receives a flattened configuration and creates the Instance Actor hierarchy.
|
||||
- **To update**: modify the script in the template, then redeploy the instance (`instance deploy --id <N>`).
|
||||
- Redeployment stops the existing Instance Actor and all its children, creates a new Instance Actor, and recompiles all scripts and alarms from the updated configuration.
|
||||
- There is no way to hot-reload a single instance script without redeploying the entire instance.
|
||||
|
||||
### Shared Scripts
|
||||
|
||||
- Compiled at the site when received from central via artifact deployment (`deploy artifacts`).
|
||||
- The `SharedScriptLibrary` replaces its in-memory compiled code dictionary under a lock, making updated code immediately available to all Script Actors.
|
||||
- **To update**: modify the shared script via the CLI or UI, then run `deploy artifacts` to push the change to sites.
|
||||
- No instance redeployment is required — running instances pick up the new shared script code on the next `Scripts.CallShared()` invocation.
|
||||
|
||||
### Inbound API Method Scripts
|
||||
|
||||
- See Component-InboundAPI.md for the compilation and hot-reload lifecycle of API method scripts.
|
||||
|
||||
> **Warning**: Editing scripts via direct SQL does not trigger recompilation. The in-memory compiled script will remain stale until the next node restart or redeployment. Always use the CLI, Management API, or Central UI to modify scripts.
|
||||
|
||||
---
|
||||
|
||||
## Script Runtime API
|
||||
|
||||
Available to all Script Execution Actors and Alarm Execution Actors:
|
||||
|
||||
Reference in New Issue
Block a user