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
email-fatal ;
: build-loop ( -- )
- notify-heartbeat
-
[
builds-dir get make-directories
builds-dir get [
build-loop ;
-MAIN: build-loop
\ No newline at end of file
+: mason ( -- * )
+ [ heartbeat-loop ] "Heartbeat loop" spawn
+ [ build-loop ] "Build loop" spawn
+ stop ;
+
+MAIN: mason
\ No newline at end of file
: 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 ;
: 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 ;