Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -5056,11 +5056,11 @@ (db:no-sync-del! no-sync-db keyname) #t) #f))) ;; straight forward copy based sync -;; 1. for each .db file +;; 1. for each .db fil ;; 2. next if file changed since last sync cycle ;; 2. next if time delta /tmp file to MTRA less than 3 seconds ;; 3. get a lock for the file in nosyncdb ;; 4. copy the file ;; 5. when copy is done release the lock @@ -5074,20 +5074,21 @@ (last-time (current-seconds)) ;; last time through the sync loop (no-sync-db (db:open-no-sync-db)) (sync-duration 0) ;; run time of the sync in milliseconds (tmp-area (common:get-db-tmp-area))) (set! *no-sync-db* no-sync-db) ;; make the no sync db available to api calls - (debug:print-info 2 *default-log-port* "Periodic sync thread started.") + (debug:print-info 2 *default-log-port* "Periodic copy-based sync thread started. sync is "legacy-sync", tmp-area is "tmp-area) (debug:print-info 3 *default-log-port* "watchdog starting. legacy-sync is "legacy-sync" pid="(current-process-id));; " this-wd-num="this-wd-num) (if (and legacy-sync (not *time-to-exit*)) (begin - (debug:print-info 0 *default-log-port* "Server running, periodic sync started.") + (debug:print-info 0 *default-log-port* "Server running, periodic copy-based sync started.") (let loop () ;; sync for filesystem local db writes ;; (let* ((dbfiles (glob (conc tmp-area"/.db/*.db")))) + (debug:print-info 0 "dbfiles: "dbfiles) (for-each (lambda (file) (let* ((fname (pathname-file file)) (fulln (conc *top-level*"/.db/"fname)) (time1 (file-modification-time fname)) @@ -5095,21 +5096,23 @@ (changed (>= time1 time2)) (do-cp (cond ((not (file-exists? fulln)) ;; shouldn't happen, but this might recover (debug:print-info 0 "File "fulln" not found! Copying "fname" to "fulln) #t) - ((and changed - (> (- (current-seconds) time1) 3)) ;; if file is changed and three seconds have passed. + (changed ;; (and changed + ;; (> (- (current-seconds) time1) 3)) ;; if file is changed and three seconds have passed. #t) ((and changed *time-to-exit*) ;; last copy #t) (else #f)))) + (debug:print-info 0 "file: "file", fname: "fname", time1: "time1", time2: "time2) (if do-cp (let* ((start-time (current-milliseconds))) (db:lock-and-sync no-sync-db fname fulln) - (set! sync-duration (- (current-milliseconds) start-time)))))) + (set! sync-duration (- (current-milliseconds) start-time))) + (debug:print-info 0 "skipping sync...")))) dbfile)) ;; keep going unless time to exit ;; (if (not *time-to-exit*) (let delay-loop ((count 0)) Index: http-transport.scm ================================================================== --- http-transport.scm +++ http-transport.scm @@ -490,11 +490,11 @@ (debug:print-info 0 *default-log-port* "WARNING: interface changed, refreshing iface and port info") (set! iface new-iface) (set! port new-port) (if (not *server-id*) (set! *server-id* (server:mk-signature))) - (debug:print 0 *default-log-port* (current-seconds) (current-directory) (current-process-id) (argv)) + (debug:print-info 0 *default-log-port* (current-seconds)" "(current-directory)" " (current-process-id) (argv)) (debug:print 0 *default-log-port* "SERVER STARTED: " iface ":" port " AT " (current-seconds) " server-id: " *server-id*) (flush-output *default-log-port*))) ;; Transfer *db-last-access* to last-access to use in checking that we are still alive (mutex-lock! *heartbeat-mutex*)