[title] Add wget option of timeout for fail of server connection
authorSungmin kim <dev.sungmin.kim@samsung.com>
Mon, 22 Apr 2013 07:35:32 +0000 (16:35 +0900)
committerSungmin kim <dev.sungmin.kim@samsung.com>
Mon, 22 Apr 2013 07:35:32 +0000 (16:35 +0900)
src/pkg_server/downloader.rb

index 9d28540723cd4b4ff38f069b8287eba8cf5c95bc..8a1ef961afb75bdb0bcc69b49fa6c3a87cc70f2a 100644 (file)
@@ -46,9 +46,9 @@ class FileDownLoader
                logger.info "Downloading #{url}"
                if is_remote then
                        if logger.path.nil? or logger.path.empty? then
-                               ret = system "wget #{url} -O #{fullpath} -nv --tries=3"
+                               ret = system "wget #{url} -O #{fullpath} -nv --tries=3 --connect-timeout=10"
                        else                            
-                               pid,status = Utils.execute_shell_with_log( "wget #{url} -O #{fullpath} -nv --tries=3", logger.path )
+                               pid,status = Utils.execute_shell_with_log( "wget #{url} -O #{fullpath} -nv --tries=3 --connect-timeout=10", logger.path )
                                if not status.nil? then
                                        ret = (status.exitstatus != 0) ? false : true
                                end
@@ -66,8 +66,8 @@ class FileDownLoader
                if ret then
                        logger.info "Downloaded #{filename}.. OK"
                else
-                       logger.info "Failed to download #{filename}"
-                       logger.info "  [dist: #{path}]"
+                       logger.error "Failed to download #{filename}"
+                       logger.error "  [dist: #{path}]"
                end
                return ret
        end