diff options
author | Christopher Baines <mail@cbaines.net> | 2020-06-27 19:47:30 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2020-07-01 17:35:22 +0100 |
commit | ab51128ee62b22971ea8b52d550e09d1c38f8ecd (patch) | |
tree | 8a343c19864f378f0afd1136f85b5447464605a9 /guix-build-coordinator | |
parent | 677d2b8821d9bbb1ab2fb1a05cddd35b3786afa3 (diff) | |
download | build-coordinator-ab51128ee62b22971ea8b52d550e09d1c38f8ecd.tar build-coordinator-ab51128ee62b22971ea8b52d550e09d1c38f8ecd.tar.gz |
Support storing when builds are created
Diffstat (limited to 'guix-build-coordinator')
-rw-r--r-- | guix-build-coordinator/datastore/sqlite.scm | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/guix-build-coordinator/datastore/sqlite.scm b/guix-build-coordinator/datastore/sqlite.scm index a7ff175..88db088 100644 --- a/guix-build-coordinator/datastore/sqlite.scm +++ b/guix-build-coordinator/datastore/sqlite.scm @@ -736,7 +736,7 @@ GROUP BY derivations.system"))) (sqlite-prepare db " -SELECT uuid, derivation_name, priority, processed +SELECT uuid, derivation_name, priority, processed, created_at FROM builds WHERE uuid = :uuid"))) @@ -746,7 +746,7 @@ WHERE uuid = :uuid"))) (let ((result (match (sqlite-step statement) - (#(uuid derivation_name priority processed) + (#(uuid derivation_name priority processed created_at) `((uuid . ,uuid) (derivation-name . ,derivation_name) (priority . ,priority) @@ -754,7 +754,11 @@ WHERE uuid = :uuid"))) ((= 0 processed) #f) ((= 1 processed) #t) (else - (error "unknown processed value"))))))))) + (error "unknown processed value")))) + (created-at . ,(if (string? created_at) + (match (strptime "%F %T" created_at) + ((parts _) parts)) + #f))))))) (sqlite-reset statement) result))))) @@ -1781,8 +1785,8 @@ INSERT INTO derivation_outputs (derivation_name, name, output) VALUES " (sqlite-prepare db " -INSERT INTO builds (uuid, derivation_name, priority) -VALUES (:uuid, :derivation_name, :priority)"))) +INSERT INTO builds (uuid, derivation_name, priority, created_at) +VALUES (:uuid, :derivation_name, :priority, datetime('now'))"))) (sqlite-bind-arguments statement |