Prevent freezing outgoing

pull/5816/head
Maki Nishifuji 9 years ago
parent 1f3d7358e9
commit 64876bd290
  1. 21
      packages/rocketchat-integrations/server/triggers.coffee

@ -79,7 +79,26 @@ executeScript = (integration, method, params) ->
return
try
result = script[method](params)
sandbox =
_: _
s: s
console: console
Store:
set: (key, val) ->
return store[key] = val
get: (key) ->
return store[key]
HTTP: (method, url, options) ->
try
return {} =
result: HTTP.call method, url, options
catch e
return {} =
error: e
script: script
method: method
params: params
result = vm.runInNewContext('script[method](params)', sandbox, { timeout: 3000 })
logger.outgoing.debug '[Script method [', method, '] result of Trigger', integration.name, ':]'
logger.outgoing.debug result

Loading…
Cancel
Save