@@ -204,10 +204,11 @@ tabdat)) ;; gets and calls updater list based on curr-tab-num ;; (define (dboard:common-run-curr-updaters commondat #!key (tab-num #f)) + (copy-db-to-tmp) (if (dboard:common-get-tabdat commondat tab-num: tab-num) ;; only update if there is a tabdat (let* ((tnum (or tab-num (dboard:commondat-curr-tab-num commondat))) (updaters (hash-table-ref/default (dboard:commondat-updaters commondat) tnum '()))) @@ -1940,11 +1941,11 @@ (dashboard:run-id->tests-mindat dest-run-id tabdat runs-hash) hide-clean: hide-clean) #f))) -(define (dashboard:get-runs-hash tabdat) +(define (dashboard:get-runs-hash tabdat) (let* ((access-mode (dboard:tabdat-access-mode tabdat)) (last-runs-update 0);;(dboard:tabdat-last-runs-update tabdat)) (runs-dat (rmt:get-runs-by-patt (dboard:tabdat-keys tabdat) "%" #f #f #f #f last-runs-update)) (runs-header (vector-ref runs-dat 0)) ;; 0 is header, 1 is list of records (runs (vector-ref runs-dat 1)) @@ -3854,14 +3855,30 @@ ) "update buttons once")) (th2 (make-thread iup:main-loop "Main loop"))) (print "Starting main loop") (thread-start! th2) (thread-join! th2) - ) - ) - ) - ) + ) + ) + ) +) + +(define last-copy-time 0) + + +;; Do this only if in read-only mode. + +(define (copy-db-to-tmp) + (let* ((db-file "./.megatest/main.db")) + (if (and (not (file-write-access? db-file)) ( > (current-seconds) (+ last-copy-time 5))) + (begin + (system (conc "rsync -a .megatest " (common:get-db-tmp-area))) + (set! last-copy-time (current-seconds)) + ) + ) + ) +) ;; ########################### top level code ######################## ;; check for MT_* environment variables and exit if found (if (not (args:get-arg "-test")) (begin