905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
|
(cont-run #f))
(let* ((run-id (db:get-value-by-header run header "id"))
(recently-done (< (- (current-seconds)
(hash-table-ref/default *dashboard-last-run-id-update* run-id 0)) 3))
(run-struct (hash-table-ref/default (dboard:tabdat-allruns-by-id tabdat) run-id #f))
;; (last-update (if run-struct (dboard:rundat-last-update run-struct) 0))
(key-vals (rmt:get-key-vals run-id))
(tests-ht (let* ((tht (if recently-done
(let ((rht (dboard:rundat-tests run-struct))) ;; (dboard:tabdat-allruns-by-id tabdat)))
(or rht
(dboard:get-tests-for-run-duplicate tabdat run-id run testnamepatt key-vals)))
(dboard:get-tests-for-run-duplicate tabdat run-id run testnamepatt key-vals))))
(assert (hash-table? tht) "FATAL: But here tht should be a hash-table")
tht))
;; GET RID OF dboard:get-tests-dat - it is superceded by dboard:get-tests-for-run-duplicate
;; dboard:get-tests-for-run-duplicate - returns a hash table
;; (dboard:get-tests-dat tabdat run-id last-update))
(all-test-ids (hash-table-keys tests-ht))
(num-tests (length all-test-ids))
;; (print "run-struct: " run-struct)
|
|
|
|
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
|
(cont-run #f))
(let* ((run-id (db:get-value-by-header run header "id"))
(recently-done (< (- (current-seconds)
(hash-table-ref/default *dashboard-last-run-id-update* run-id 0)) 3))
(run-struct (hash-table-ref/default (dboard:tabdat-allruns-by-id tabdat) run-id #f))
;; (last-update (if run-struct (dboard:rundat-last-update run-struct) 0))
(key-vals (rmt:get-key-vals run-id))
(tests-ht (let* ((tht (if (and recently-done run-struct)
(let ((rht (dboard:rundat-tests run-struct))) ;; (dboard:tabdat-allruns-by-id tabdat)))
(or rht
(dboard:get-tests-for-run-duplicate tabdat run-id run testnamepatt key-vals)))
(dboard:get-tests-for-run-duplicate tabdat run-id run testnamepatt key-vals))))
(assert (hash-table? tht) "FATAL: But here tht should be a hash-table")
tht))
;; GET RID OF dboard:get-tests-dat - it is superceded by dboard:get-tests-for-run-duplicate
;; dboard:get-tests-for-run-duplicate - returns a hash table
;; (dboard:get-tests-dat tabdat run-id last-update))
(all-test-ids (hash-table-keys tests-ht))
(num-tests (length all-test-ids))
;; (print "run-struct: " run-struct)
|
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
|
;; Sync to tmp only if in read-only mode.
(define (sync-db-to-tmp tabdat)
(let* ((db-file "./.mtdb/main.db"))
(if (and (not (file-write-access? db-file)) ( > (current-seconds) (+ last-copy-time 5)))
(begin
(db:multi-db-sync (db:setup #f) 'old2new)
(set! last-copy-time (current-seconds))
)
)
)
)
;; ########################### top level code ########################
|
|
|
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
|
;; Sync to tmp only if in read-only mode.
(define (sync-db-to-tmp tabdat)
(let* ((db-file "./.mtdb/main.db"))
(if (and (not (file-write-access? db-file)) ( > (current-seconds) (+ last-copy-time 5)))
(begin
(db:multi-db-sync (db:setup) 'old2new)
(set! last-copy-time (current-seconds))
)
)
)
)
;; ########################### top level code ########################
|