소스 검색

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

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