Skip to content

feat: customizable fn timeout#203

Open
stefan-gorules wants to merge 2 commits intomasterfrom
feat/customizable-fn-timeout
Open

feat: customizable fn timeout#203
stefan-gorules wants to merge 2 commits intomasterfrom
feat/customizable-fn-timeout

Conversation

@stefan-gorules
Copy link
Copy Markdown
Contributor

@stefan-gorules stefan-gorules commented Jul 4, 2024

Customizable Function Timeout

This PR introduces configurable timeouts for function execution in both Node.js bindings and the core engine. The default timeout has been increased to 5000ms for better handling of complex operations.

Features

  • 🎛️ Added configurable function timeout
  • ⚡ Applied timeout settings to both v1 and modern function handlers

Technical Changes

  • Added functionTimeout option to Node.js configuration interface
  • Implemented timeout configuration storage using AtomicU64
  • Updated function handlers to use the configured timeout value
  • Applied consistent timeout handling across different function execution contexts

Example Usage

import { overrideConfig } from '@gorules/zen-engine';

// Set custom function timeout (in milliseconds)
overrideConfig({
  functionTimeout: 10000, // 10 seconds
  nodesInContext: true
});

@stefan-gorules stefan-gorules force-pushed the feat/customizable-fn-timeout branch from b078d6b to e9e7662 Compare October 24, 2024 16:13
@stefan-gorules stefan-gorules linked an issue Oct 24, 2024 that may be closed by this pull request
@TheCaffinatedDeveloper
Copy link
Copy Markdown

Can we merge this :)

@nimbit-software
Copy link
Copy Markdown

@stefan-gorules @ivanmiletic Is it possible to set the timeout in the js functions? This would be awewsome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Getting timeout issue while executing the function

4 participants