Skip to content

Commit eb8d8a8

Browse files
author
Bart Veneman
committed
add 8s timeouts
1 parent e5dc243 commit eb8d8a8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

api/v2/_extract-css-basic.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ function getImportUrls(css) {
3535

3636
export async function getCssFile(url) {
3737
try {
38-
var { body } = await got(url)
38+
var { body } = await got(url, {
39+
timeout: 8000
40+
})
3941
return body
4042
} catch (error) {
4143
console.error(`CSS not found at ${url} (HTTP ${error.response.statusCode})`)
@@ -97,7 +99,9 @@ export async function extractCss(url) {
9799
let headers = {}
98100

99101
try {
100-
var response = await got(url)
102+
var response = await got(url, {
103+
timeout: 8000
104+
})
101105
body = response.body
102106
headers = response.headers
103107
} catch (error) {

0 commit comments

Comments
 (0)