Skip to content

How to define timeouts #112

@tsafs

Description

@tsafs

First of all, thank you for this work.

Is there an official way to define a timeout of the JavaScript running in .eval()? I want to prevent malicious code to run for longer than a specific amount of time.

I dug through the tests and source code. The only way I see it done is to

  • either wrap the to be evaluated JS in a JS wrapper that fails if the task takes too long
  • or handle this from within Python and call CEngine::TerminateAllThreads if the task takes too long.

Thanks

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions