Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]How do I set a timeout if I have an infinite loop in my script? #383

Closed
MayDay-wpf opened this issue Aug 26, 2024 · 2 comments
Closed
Labels

Comments

@MayDay-wpf
Copy link

How do I set a timeout if I have an infinite loop in my script?

@oleg-shilo
Copy link
Owner

You need to approach this problem the same way as in the compiled (non-script application).

CLR, understandably, does not provide any specific mechanism for that so you will need to implement it by yourself. IE run your task in a separate thread and monitor/abort it

@MayDay-wpf
Copy link
Author

Thank you for your idea, but it seems that threads cannot be used in my application scenario, and separate processes are needed, but the exception communication between processes will be more tedious. I temporarily choose to use the jsonschema pattern of LLM to check the possibility of infinite loop of the script, and the accuracy can meet the requirements, a strange solution 😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants