never allow any js that takes longer than 5 seconds to run.
This commit is contained in:
parent
eb956a909f
commit
6ebc2dcf5c
|
@ -46,7 +46,8 @@ module PrettyText
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.create_new_context
|
def self.create_new_context
|
||||||
ctx = V8::Context.new
|
# timeout any eval that takes longer that 5 seconds
|
||||||
|
ctx = V8::Context.new(timeout: 5000)
|
||||||
|
|
||||||
ctx["helpers"] = Helpers.new
|
ctx["helpers"] = Helpers.new
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue