Переглянути джерело

Добавлены таймауты

Book Pauk 2 роки тому
батько
коміт
0e29546fc5
1 змінених файлів з 4 додано та 2 видалено
  1. 4 2
      server/core/FileDownloader.js

+ 4 - 2
server/core/FileDownloader.js

@@ -12,7 +12,8 @@ class FileDownloader {
 
         const options = {
             headers: {
-                'user-agent': userAgent
+                'user-agent': userAgent,
+                timeout: 300*1000,
             },
             responseType: 'stream',
         };
@@ -67,7 +68,8 @@ class FileDownloader {
     async head(url) {
         const options = {
             headers: {
-                'user-agent': userAgent
+                'user-agent': userAgent,
+                timeout: 10*1000,
             },
         };