@@ -22,11 +22,11 @@ (declare (unit rmt)) (declare (uses api)) (declare (uses http-transport)) (include "common_records.scm") -(include "db_records.scm") +;; (include "db_records.scm") ;; (declare (uses rmtmod)) ;; (import rmtmod) @@ -532,18 +532,26 @@ ;; run-id is NOT used - but it will be! ;; (define (rmt:get-test-info-by-id run-id test-id) (if (number? test-id) (let* ((testdat (rmt:send-receive 'get-test-info-by-id run-id (list run-id test-id))) - (trundatf (conc (db:test-get-rundir testdat) "/.mt_data/test-run.dat"))) + (trundir (vector-ref testdat 10)) + (trundatf (conc trundir"/.mt_data/test-run.dat"))) ;; now we can update a couple fields from the filesystem - (if (and (db:test-get-rundir testdat) - (file-exists? trundatf)) - (let* ((duration (db:test-get-run_duration testdat)) - (event-time (db:test-get-event_time testdat)) - (last-touch (file-modification-time trundatf))) - (db:test-set-run_duration! testdat (max duration (- last-touch event-time))))) + (handle-exceptions + exn + (begin + (debug:print-info 0 *default-log-port* "Could not update testdat record from "trundatf", exn=" exn) + #f) + (if (and trundir + (file-exists? trundatf)) + (let* ((duration (vector-ref testdat 12)) ;; (db:test-get-run_duration testdat)) + (event-time (vector-ref testdat 5)) ;; (db:test-get-event_time testdat)) + (last-touch (file-modification-time trundatf)) + (new-duration (max duration (- last-touch event-time)))) + (vector-set! testdat 12 new-duration)))) + #;(db:test-set-run_duration! testdat (max duration (- last-touch event-time))) testdat) (begin (debug:print 0 *default-log-port* "WARNING: Bad data handed to rmt:get-test-info-by-id run-id=" run-id ", test-id=" test-id) (print-call-chain (current-error-port)) #f)))