1 ! Copyright (C) 2008, 2010 Eduardo Cavazos, Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors calendar continuations debugger io
4 io.directories io.sockets io.streams.string kernel mason.build
5 mason.config mason.disk mason.email mason.notify mason.updates
6 namespaces prettyprint threads ;
9 : heartbeat-loop ( -- )
14 : fatal-error-body ( error callstack -- string )
16 "Fatal error on " write host-name print nl
17 [ error. ] [ callstack. ] bi*
18 ] with-string-writer ;
20 : build-loop-error ( error callstack -- )
27 builds-dir get make-directories
31 should-build? [ do-build ] [ 5 minutes sleep ] if
34 error-continuation get call>> build-loop-error
41 [ heartbeat-loop ] "Heartbeat loop" spawn
42 [ build-loop ] "Build loop" spawn