Index: dbmod.scm ================================================================== --- dbmod.scm +++ dbmod.scm @@ -1713,11 +1713,11 @@ ;; dneeded is minimum space needed, scan for existing archives that ;; are on disks with adequate space and already have this test/itempath ;; archived ;; (define (db:archive-get-allocations dbstruct testname itempath dneeded) - (let* ((db (db:get-inmem dbstruct #f)) ;; archive tables are in main.db + (let* ((db (db:get-inmem dbstruct (db:run-id->dbname #f))) ;; archive tables are in main.db (res '()) (blocks '())) ;; a block is an archive chunck that can be added too if there is space (sqlite3:for-each-row (lambda (id archive-disk-id disk-path last-du last-du-time) (set! res (cons (vector id archive-disk-id disk-path last-du last-du-time) res))) @@ -1745,11 +1745,11 @@ ;; available space ;; ;; NEEDS WORK! THIS WILL LIKELY NOT WORK AS IS! ;; (define (db:archive-register-disk dbstruct bdisk-name bdisk-path df) - (let* ((db (db:get-inmem dbstruct #f)) ;; archive tables are in main.db + (let* ((db (db:get-inmem dbstruct (db:run-id->dbname #f))) ;; archive tables are in main.db (res #f)) (sqlite3:for-each-row (lambda (id) (set! res id)) db @@ -1772,11 +1772,11 @@ ;; record an archive path created on a given archive disk (identified by it's bdisk-id) ;; if path starts with / then it is full, otherwise it is relative to the archive disk ;; preference is to store the relative path. ;; (define (db:archive-register-block-name dbstruct bdisk-id archive-path #!key (du #f)) - (let* ((db (db:get-inmem dbstruct #f)) ;; archive tables are in main.db + (let* ((db (db:get-inmem dbstruct (db:run-id->dbname #f))) ;; archive tables are in main.db (res #f)) ;; first look to see if this path is already registered (sqlite3:for-each-row (lambda (id) (set! res id)) @@ -1823,11 +1823,11 @@ "SELECT id,archive_disk_id,disk_path,last_du,last_du_time,creation_time FROM archive_blocks WHERE id=?;" archive-block-id) res)))) ;; (define (db:archive-allocate-testsuite/area-to-block block-id testsuite-name areakey) -;; (let* ((dbdat (db:get-inmem dbstruct #f)) ;; archive tables are in main.db +;; (let* ((dbdat (db:get-inmem dbstruct (db:run-id->dbname #f))) ;; archive tables are in main.db ;; (db (db:dbdat-get-db dbdat)) ;; (res '()) ;; (blocks '())) ;; a block is an archive chunck that can be added too if there is space ;; (sqlite3:for-each-row #f) @@ -2101,11 +2101,11 @@ ;; b. .... ;; (define (db:clean-up dbdat run-id) ;; (debug:print 0 *default-log-port* "WARNING: db clean up not fully ported to v1.60, cleanup action will be on megatest.db") (let* ((keep-record-age ( - (current-seconds) (common:hms-string->seconds (or (configf:lookup *configdat* "setup" "delete-record-age") "30d")))) - (db (db:get-inmem dbdat run-id)) + (db (db:get-inmem dbdat (db:run-id->dbname run-id))) (count-stmt (sqlite3:prepare db "SELECT (SELECT count(id) FROM tests)+(SELECT count(id) FROM runs);")) (statements (map (lambda (stmt) (sqlite3:prepare db stmt)) (list @@ -2156,11 +2156,11 @@ ;; a. If have tests that are not deleted, set state='unknown' ;; b. .... ;; (define (db:clean-up-rundb dbdat run-id) ;; (debug:print 0 *default-log-port* "WARNING: db clean up not fully ported to v1.60, cleanup action will be on megatest.db") - (let* ((db (db:get-inmem dbdat run-id)) + (let* ((db (db:get-inmem dbdat (db:run-id->dbname run-id))) (count-stmt (sqlite3:prepare db "SELECT (SELECT count(id) FROM tests);")) (statements (map (lambda (stmt) (sqlite3:prepare db stmt)) (list Index: tasksmod.scm ================================================================== --- tasksmod.scm +++ tasksmod.scm @@ -585,11 +585,11 @@ (define (tasks:find-task-queue-records dbstruct target run-name test-patt state-patt action-patt) ;; (handle-exceptions ;; exn ;; '() ;; (sqlite3:first-row - (let ((db (db:get-inmem dbstruct #f)) ;; put tasks stuff in main.db + (let ((db (db:get-inmem dbstruct (db:run-id->dbname #f))) ;; put tasks stuff in main.db (res '())) (sqlite3:for-each-row (lambda (a . b) (set! res (cons (cons a b) res))) db "SELECT id,action,owner,state,target,name,testpatt,keylock,params FROM tasks_queue