Index: common.scm ================================================================== --- common.scm +++ common.scm @@ -605,15 +605,15 @@ (define (common:readonly-watchdog dbstruct) (thread-sleep! 0.05) ;; delay for startup (BB> "common:readonly-watchdog entered.") ;; sync megatest.db to /tmp/.../megatst.db - (let ((sync-cool-off-duration 3) + (let* ((sync-cool-off-duration 3) (golden-mtdb (dbr:dbstruct-mtdb dbstruct)) - (golden-mtpath (db:dbdat-get-path mtdb)) + (golden-mtpath (db:dbdat-get-path golden-mtdb)) (tmp-mtdb (dbr:dbstruct-tmpdb dbstruct)) - (tmp-mtpath (db:dbdat-get-path mtdb))) + (tmp-mtpath (db:dbdat-get-path tmp-mtdb))) (debug:print-info 0 *default-log-port* "Read-only periodic sync thread started.") (let loop ((last-sync-time 0)) (BB> "loop top tmp-mtpath="tmp-mtpath" golden-mtpath="golden-mtpath) (let* ((duration-since-last-sync (- (current-seconds) last-sync-time))) (BB> "duration-since-last-sync="duration-since-last-sync) @@ -623,13 +623,13 @@ (if (not *time-to-exit*) (let ((golden-mtdb-mtime (file-modification-time golden-mtpath)) (tmp-mtdb-mtime (file-modification-time tmp-mtpath))) (if (> golden-mtdb-mtime tmp-mtdb-mtime) (let ((res (db:multi-db-sync dbstruct 'old2new))) - (debug:print-info 0 *default-log-port* "rosync called, " res " records transferred.")) - (loop (current-seconds))) - #t)))) + (debug:print-info 0 *default-log-port* "rosync called, " res " records transferred."))) + (loop (current-seconds))) + #t))) (debug:print-info 0 *default-log-port* "Exiting readonly-watchdog timer, *time-to-exit* = " *time-to-exit*" pid="(current-process-id)" mtpath="golden-mtpath))) (define (common:writable-watchdog dbstruct) @@ -705,11 +705,11 @@ (let ((dbstruct (db:setup))) (cond ((dbr:dbstruct-read-only dbstruct) (BB> "loading read-only watchdog") - common:readonly-watchdog dbstruct) + (common:readonly-watchdog dbstruct)) (else (BB> "loading writable-watchdog.") (common:writable-watchdog dbstruct)))) (BB> "watchdog done.");;) ) Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -283,11 +283,11 @@ (mtdb (db:open-megatest-db)) (mtdbpath (db:dbdat-get-path mtdb)) (mtdbexists (file-exists? mtdbpath)) (refndb (db:open-megatest-db path: dbpath name: "megatest_ref.db")) (write-access (file-write-access? mtdbpath))) - (BB> "db:open-db>> mtdbpath="mtdbpath" mtdbexists="mtdbexists" and write-access="write-access) + ;;(BB> "db:open-db>> mtdbpath="mtdbpath" mtdbexists="mtdbexists" and write-access="write-access) (if (and dbexists (not write-access)) (begin (set! *db-write-access* #f) (dbr:dbstruct-read-only-set! dbstruct #t))) (dbr:dbstruct-mtdb-set! dbstruct mtdb) (dbr:dbstruct-tmpdb-set! dbstruct tmpdb) @@ -315,11 +315,11 @@ (else ;;(common:on-homehost?) (let* ((dbstruct (make-dbr:dbstruct))) (when (not *toppath*) (launch:setup areapath: areapath)) (db:open-db dbstruct areapath: areapath) (set! *dbstruct-db* dbstruct) - (BB> "new dbstruct = "(dbr:dbstruct->alist dbstruct)) + ;;(BB> "new dbstruct = "(dbr:dbstruct->alist dbstruct)) dbstruct)))) ;; (else ;; (debug:print 0 *default-log-port* "ERROR: attempt to open database when not on homehost. Exiting. Homehost: " (common:get-homehost)) ;; (exit 1))))