]> gitweb.factorcode.org Git - factor.git/commitdiff
mason: make upload timeout configurable, bump default to 1 hour for erg's mom's dialup
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 16 Sep 2010 05:53:54 +0000 (22:53 -0700)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 16 Sep 2010 05:53:54 +0000 (22:53 -0700)
extra/mason/common/common.factor
extra/mason/config/config.factor

index 08b979e744b93e082e984723b14578585490428a..798f4d166a02b956fac57427f5f64e620ee77375 100644 (file)
@@ -38,12 +38,17 @@ M: unix (really-delete-tree) delete-tree ;
     [ iota ] dip
     '[ drop @ f ] attempt-all drop ; inline
 
+: upload-process ( process -- )
+    #! Give network operations and shell commands at most
+    #! 30 minutes to complete, to catch hangs.
+    >process upload-timeout get >>timeout try-output-process ;
+
 :: upload-safely ( local username host remote -- )
     remote ".incomplete" append :> temp
     { username "@" host ":" temp } concat :> scp-remote
     scp-command get :> scp
     ssh-command get :> ssh
-    5 [ { scp local scp-remote } short-running-process ] retry
+    5 [ { scp local scp-remote } upload-process ] retry
     5 [ { ssh host "-l" username "mv" temp remote } short-running-process ] retry ;
 
 : eval-file ( file -- obj )
index 1d433864569cef9f777708c57d4f0adc3605cefd..9d8c8b86924f0e2f18a898abbcd2667d4cbb125e 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2008, 2010 Eduardo Cavazos, Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: system io.files io.pathnames namespaces kernel accessors
-assocs ;
+USING: calendar system io.files io.pathnames namespaces kernel
+accessors assocs ;
 IN: mason.config
 
 ! (Optional) Location for build directories
@@ -97,6 +97,10 @@ SYMBOL: upload-username
 ! Directory with binary packages.
 SYMBOL: upload-directory
 
+! Upload timeout
+SYMBOL: upload-timeout
+1 hours upload-timeout set-global
+
 ! Optional: override ssh and scp command names
 SYMBOL: scp-command
 scp-command [ "scp" ] initialize