From 1e4d3dceb8a2557679b16e52de8fbee557f90384 Mon Sep 17 00:00:00 2001 From: LD-Reborn Date: Sat, 23 Aug 2025 17:16:17 +0200 Subject: [PATCH] Added runonce to the documentation; added information about the necessary functions --- docs/Indexer.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/Indexer.md b/docs/Indexer.md index f25ee5b..d83ab4d 100644 --- a/docs/Indexer.md +++ b/docs/Indexer.md @@ -54,6 +54,10 @@ If you just installed the server and want to configure it: } ``` ## Call types +- `runonce` + - What does it do: The script gets called once at startup. Use this if you need a main loop. + - (Remember the call runs in `update()` like the others!) + - Parameters: None - `interval` - What does it do: The script gets called periodically based on the specified `Interval` parameter. - Parameters: @@ -68,6 +72,13 @@ If you just installed the server and want to configure it: - Path (e.g. "Scripts/example_content") # Scripting ## General +Scripts need to define the following functions: +- `init()` + - Is run at startup. Put all initialization code here. + - Do not put a main loop here! Might cause other workers not to initialize and other unintended behavior! +- `update()` + - Is called by the calls as specified in [Call types](#call-types) + - A main loop might work best here using the `runonce` call ## probMethods Probmethods are used to join the multiple similarity values from multiple models and multiple datapoints into one single result.