@browserless/function 9.2.3 → 9.2.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +4 -4
  2. package/src/index.js +3 -1
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@browserless/function",
3
3
  "description": "Run abritrary JavaScript inside a browser sandbox",
4
4
  "homepage": "https://browserless.js.org",
5
- "version": "9.2.3",
5
+ "version": "9.2.14",
6
6
  "main": "src/index.js",
7
7
  "author": {
8
8
  "email": "hello@microlink.io",
@@ -29,13 +29,13 @@
29
29
  "serverless"
30
30
  ],
31
31
  "dependencies": {
32
- "@browserless/errors": "^9.1.6",
32
+ "@browserless/errors": "^9.2.14",
33
33
  "debug-logfmt": "~1.0.4",
34
34
  "deepmerge": "~4.2.2",
35
35
  "execa": "~5.1.1",
36
36
  "p-event": "~4.2.0",
37
37
  "p-reflect": "~2.1.0",
38
- "p-retry": "~4.6.0",
38
+ "p-retry": "~4.6.1",
39
39
  "p-timeout": "~4.1.0",
40
40
  "require-one-of": "~1.0.15",
41
41
  "serialize-error": "~8.1.0",
@@ -61,5 +61,5 @@
61
61
  "timeout": "2m",
62
62
  "verbose": true
63
63
  },
64
- "gitHead": "dac162639d969ba1862516bfb3273158af205f5c"
64
+ "gitHead": "c1c9dca5f97b375666eaab24137dc362dd5a8f69"
65
65
  }
package/src/index.js CHANGED
@@ -21,13 +21,14 @@ module.exports = (
21
21
  return async (url, query = {}) => {
22
22
  const browserlessPromise = getBrowserless()
23
23
  let isRejected = false
24
+ let subprocess
24
25
 
25
26
  async function run () {
26
27
  const browserless = await browserlessPromise
27
28
  const browser = await browserless.browser()
28
29
  const browserWSEndpoint = browser.wsEndpoint()
29
30
 
30
- const subprocess = execa.node(execPath, { killSignal: 'SIGKILL', timeout })
31
+ subprocess = execa.node(execPath)
31
32
  subprocess.stderr.pipe(process.stderr)
32
33
 
33
34
  debug('spawn', { pid: subprocess.pid })
@@ -61,6 +62,7 @@ module.exports = (
61
62
  // main
62
63
  const result = await pTimeout(task(), timeout, () => {
63
64
  isRejected = true
65
+ subprocess.kill('SIGKILL')
64
66
  throw browserTimeout({ timeout })
65
67
  })
66
68