mason: send a heartbeat even while a build is running, and tighten deadline for crashed machine in mason.server

release
Slava Pestov 2010-09-16 21:20:53 -07:00
parent 06e3fc84a6
commit b3c5097862
2 changed files with 13 additions and 5 deletions

View File

@ -7,6 +7,11 @@ namespaces prettyprint threads ;
FROM: mason.build => build ;
IN: mason
: heartbeat-loop ( -- )
notify-heartbeat
5 minutes sleep
heartbeat-loop ;
: fatal-error-body ( error callstack -- string )
[
"Fatal error on " write host-name print nl
@ -19,8 +24,6 @@ IN: mason
email-fatal ;
: build-loop ( -- )
notify-heartbeat
[
builds-dir get make-directories
builds-dir get [
@ -35,4 +38,9 @@ IN: mason
build-loop ;
MAIN: build-loop
: mason ( -- * )
[ heartbeat-loop ] "Heartbeat loop" spawn
[ build-loop ] "Build loop" spawn
stop ;
MAIN: mason

View File

@ -73,7 +73,7 @@ counter "COUNTER" {
: funny-builders ( -- crashed broken limbo )
builder new select-tuples
[ [ current-timestamp>> 5 hours ago before? ] filter ]
[ [ current-timestamp>> 1 hours ago before? ] filter ]
[ [ clean-timestamp>> 1 weeks ago before? ] filter ]
[ [ [ clean-git-id>> ] [ release-git-id>> ] bi = not ] filter ]
tri ;
@ -84,7 +84,7 @@ counter "COUNTER" {
: mason-db ( -- db ) "resource:mason.db" <sqlite-db> ;
: with-mason-db ( quot -- )
[ mason-db ] dip with-db ; inline
mason-db [ with-transaction ] with-db ; inline
: init-mason-db ( -- )
{ builder counter } ensure-tables ;