Index: dbmod.scm ================================================================== --- dbmod.scm +++ dbmod.scm @@ -97,12 +97,11 @@ (dbfile (dbr:dbdat-dbfile dbdat))) ;; if nfs mode do a sync if delta > 2 (let* ((last-update (dbr:dbstruct-last-update dbstruct)) (sync-proc (dbr:dbstruct-sync-proc dbstruct)) (curr-secs (current-seconds))) - (if (and (not (eq? (dbfile:cache-method) 'none)) ;; used by dashboard, no need for sync - (> (- curr-secs last-update) 5)) + (if (> (- curr-secs last-update) 5) (begin (sync-proc last-update) ;; MOVE THIS CALL TO INSIDE THE sync-proc CALL (dbr:dbstruct-last-update-set! dbstruct curr-secs) @@ -172,11 +171,11 @@ (lambda () (let* ((dbexists (file-exists? dbfullname)) (db (sqlite3:open-database dbfullname)) (handler (sqlite3:make-busy-timeout 136000))) (sqlite3:set-busy-handler! db handler) - (if (and dbexists + (if (and (not dbexists) write-access) (init-proc db)) db)) run-anyway: #t)) @@ -248,12 +247,13 @@ (debug:print-info "Running "sync-cmd) (if (file-exists? syncer-running-file) (debug:print-info 0 *default-log-port* "Syncer still running, skipping syncer start.") (system sync-cmd)) (set! *sync-in-progress* #f))))))) - (if (< (file-modification-time tmpdb) - (file-modification-time dbfullname)) + (if ((if (eq? syncdir 'todisk) < >) ;; use less than for todisk, greater than for from disk + (file-modification-time tmpdb) + (file-modification-time dbfullname)) (debug:print 0 *default-log-port* "Skipping sync, "tmpdb" older than "dbfullname) (if synclock-mod-time (if (< (- (current-seconds) synclock-mod-time) 20) ;; something wrong with sync, remove file (begin (handle-exceptions