Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -78,20 +78,21 @@ ;; (db:with-db dbstruct run-id sqlite3:exec "select blah from blaz;") ;; r/w is a flag to indicate if the db is modified by this query #t = yes, #f = no ;; (define (db:with-db dbstruct run-id r/w proc . params) (let* ((db (db:get-db dbstruct run-id)) - (proc (lambda () - (let ((res (apply proc db params))) - (db:done-with dbstruct run-id r/w) - res)))) - (handle-exceptions - exn - (begin - (thread-sleep! 10) - (proc)) - (proc)))) + ) + ;; (proc2 (lambda () + (let ((res (apply proc db params))) + (db:done-with dbstruct run-id r/w) + res))) +;; (handle-exceptions +;; exn +;; (begin +;; (thread-sleep! 10) +;; (proc2)) +;; (proc2)))) ;;====================================================================== ;; K E E P F I L E D B I N dbstruct ;;====================================================================== @@ -1191,16 +1192,16 @@ ;; Get run-ids for runs with same target but different runnames and NOT run-id ;; (define (db:get-prev-run-ids dbstruct run-id) (let* ((keyvals (rmt:get-key-val-pairs run-id)) - (kvalues (cdr keyvals)) + (kvalues (map cadr keyvals)) (keys (rmt:get-keys)) (qrystr (string-intersperse (map (lambda (x)(conc x "=?")) keys) " AND "))) (let ((prev-run-ids '())) (db:with-db dbstruct #f #f ;; #f means work with the zeroth db - i.e. the runs db - (lambda () + (lambda (db) (apply sqlite3:for-each-row (lambda (id) (set! prev-run-ids (cons id prev-run-ids))) db (conc "SELECT id FROM runs WHERE " qrystr " AND id != ?;") (append kvalues (list run-id)))))