MCPcopy Create free account
hub / github.com/Xenov-X/csbot / executeSleep

Method executeSleep

workflow/executor.go:843–857  ·  view source on GitHub ↗

executeSleep pauses execution

(action Action)

Source from the content-addressed store, hash-verified

841
842// executeSleep pauses execution
843func (e *Executor) executeSleep(action Action) (string, error) {
844 duration, ok := action.Parameters["duration"].(string)
845 if !ok {
846 return "", fmt.Errorf("duration parameter required for sleep")
847 }
848
849 d, err := time.ParseDuration(duration)
850 if err != nil {
851 return "", fmt.Errorf("invalid duration: %w", err)
852 }
853
854 e.logInfo("Sleeping for %s", d)
855 time.Sleep(d)
856 return "slept", nil
857}
858
859// fireAndForget is used for commands known to never produce output from the beacon.
860// The API accepted the command and returned a task ID, so we just return a success message.

Callers 1

executeActionMethod · 0.95

Calls 1

logInfoMethod · 0.95

Tested by

no test coverage detected