Browse Source

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

Book Pauk 3 năm trước cách đây
mục cha
commit
0e29546fc5
1 tập tin đã thay đổi với 4 bổ sung2 xóa
  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,
             },
         };