aboutsummaryrefslogtreecommitdiff
path: root/guix-build-coordinator/datastore
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-06-28 13:13:21 +0100
committerChristopher Baines <mail@cbaines.net>2020-07-01 17:43:38 +0100
commitdbadb56b19b76d62d0dddfdea1f1676b0366b729 (patch)
tree943bb606d509eec43c79a7530b662ff7bde16603 /guix-build-coordinator/datastore
parent3423a03688e4a03c7f83849c113aa6b6c58ed945 (diff)
downloadbuild-coordinator-dbadb56b19b76d62d0dddfdea1f1676b0366b729.tar
build-coordinator-dbadb56b19b76d62d0dddfdea1f1676b0366b729.tar.gz
Add a hook for when a build starts on an agent
Diffstat (limited to 'guix-build-coordinator/datastore')
-rw-r--r--guix-build-coordinator/datastore/sqlite.scm16
1 files changed, 13 insertions, 3 deletions
diff --git a/guix-build-coordinator/datastore/sqlite.scm b/guix-build-coordinator/datastore/sqlite.scm
index 4251f75..5ed70ac 100644
--- a/guix-build-coordinator/datastore/sqlite.scm
+++ b/guix-build-coordinator/datastore/sqlite.scm
@@ -612,8 +612,14 @@ VALUES "
build-id
agent-id)
- (call-with-worker-thread
- (slot-ref datastore 'worker-writer-thread-channel)
+ (define (handle-inserting-unprocessed-hook-event db build-id agent-id)
+ (insert-unprocessed-hook-event
+ db
+ "build-started"
+ (list build-id agent-id)))
+
+ (datastore-call-with-transaction
+ datastore
(lambda (db)
(sqlite-exec
db
@@ -625,7 +631,11 @@ INSERT INTO build_starts (
build-id "', '"
agent-id "', "
"datetime('now')"
- ")")))))
+ ")"))
+
+ (handle-inserting-unprocessed-hook-event db build-id agent-id)))
+
+ #t)
(define-method (datastore-find-build-starts
(datastore <sqlite-datastore>)