Index: dashboard.scm ================================================================== --- dashboard.scm +++ dashboard.scm @@ -2339,11 +2339,12 @@ (let ((tpatt (tasks:task-get-testpatt tlast))) (if (member tpatt '("0" 0)) ;; known bad historical value - remove in 2017 "%" tpatt)) "%"))) - (item-path (db:test-get-item-path (rmt:get-test-info-by-id run-id test-id))) + ;(item-path (db:test-get-item-path (rmt:get-test-info-by-id run-id test-id))) ; why calling rmt:get-test-info-by-id twice?? + (item-path (db:test-get-item-path test-info)) (item-test-path (conc test-name "/" (if (equal? item-path "") "%" item-path))) (status-chars (char-set->list (string->char-set status))) (run-id (dboard:tabdat-curr-run-id tabdat))) @@ -2910,11 +2911,12 @@ (let ((tpatt (tasks:task-get-testpatt tlast))) (if (member tpatt '("0" 0)) ;; known bad historical value - remove in 2017 "%" tpatt)) "%"))) - (item-path (db:test-get-item-path (rmt:get-test-info-by-id run-id test-id))) + ;(item-path (db:test-get-item-path (rmt:get-test-info-by-id run-id test-id))) + (item-path (db:test-get-item-path test-info)) (item-test-path (conc test-name "/" (if (equal? item-path "") "%" item-path)))) (iup:show (dashboard:context-menu run-id test-id target runname test-name testpatt item-test-path test-info) ;; popup-menu #:x 'mouse Index: dbfile.scm ================================================================== --- dbfile.scm +++ dbfile.scm @@ -149,20 +149,20 @@ (mutex-unlock! (dbr:subdb-stack-mutex subdb))) subdbs))) ;; close opened run-id dbs that haven't been used in age seconds (define (db:close-old dbstruct #!key (age 30)) ;; close dbs older than this age - (assert (dbr:dbstruct? dbstruct) "FATAL: db:close-all called with non-dbstruct "dbstruct) + (assert (dbr:dbstruct? dbstruct) "FATAL: db:close-old called with non-dbstruct "dbstruct) (let* ((subdbs (hash-table-values (dbr:dbstruct-subdbs dbstruct)))) (for-each (lambda (subdb) (mutex-lock! (dbr:subdb-stack-mutex subdb)) (let* ((tdbs (stack->list (dbr:subdb-dbstack subdb))) (mtdbdat (dbr:dbdat-dbh (dbr:subdb-mtdbdat subdb)))) (dbr:subdb-dbstack-set! subdb (make-stack)) ;; replace the stack with a new one (map (lambda (dbdat) - (assert (dbr:dbdat-in-use dbdat) "FATAL: dbdat in stack was in use "(dbr:dbdat-dbfile dbdat)) + (assert (not (dbr:dbdat-in-use dbdat)) "FATAL: dbdat in stack was in use "(dbr:dbdat-dbfile dbdat) " in use" (dbr:dbdat-in-use dbdat) "Stack length " (length tdbs) "time diff " (- (current-seconds) (dbr:dbdat-last-used dbdat))) (if (< (- (current-seconds) (dbr:dbdat-last-used dbdat)) age) (stack-push! (dbr:subdb-dbstack subdb) dbdat) ;; keep it (let* ((stmt-cache (dbr:dbdat-stmt-cache dbdat)) ;; close and discard @@ -306,10 +306,11 @@ (if dbdat dbdat (let* ((tmppath (dbr:dbstruct-tmppath dbstruct)) (tmpdbpath (dbfile:run-id->path tmppath run-id)) (dbdat (dbfile:open-sqlite3-db tmpdbpath init-proc sync-mode: 0 journal-mode: "WAL"))) + (dbr:dbdat-in-use-set! dbdat #t) ;; the following line short-circuits the "one db handle per thread" model ;; ;; (dbfile:add-dbdat dbstruct run-id dbdat) ;; dbdat))))))