Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

Timeout parameter does not work with .call() #395

Closed
seanmakesgames opened this issue Nov 20, 2015 · 0 comments
Closed

Timeout parameter does not work with .call() #395

seanmakesgames opened this issue Nov 20, 2015 · 0 comments

Comments

@seanmakesgames
Copy link

The following code soft-locks ruby. I have to kill -9 it to get it to stop. Timeout works fine when I run it inside of eval().

            ctx = V8::Context.new({timeout: timeout_seconds*1000})
            ctx[:db] = DatabaseConnection.new

            Timeout::timeout(timeout_seconds) {
                ctx.eval(code_to_execute) // includes while(true); inside of SCRIPTCALL_TOP_LEVEL

                result["retval"] = ctx[:SCRIPTCALL_TOP_LEVEL].call(
                    {
                        :caller => @current_user.name,
                        :calling_script => nil,
                        :this_script => params["script_name"]
                    },
                    RunProcessor.process_args(params["args"])
                )
            }
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants