Index: common.scm ================================================================== --- common.scm +++ common.scm @@ -416,18 +416,30 @@ ;;====================================================================== ;; Move me elsewhere ... ;; RADT => Why do we meed the version check here, this is called only if version misma ;; (define (common:cleanup-db dbstruct #!key (full #f)) - (apply db:multi-db-sync - dbstruct - 'schema - 'killservers - 'adj-target - 'new2old - '(dejunk) - ) + (case (rmt:transport-mode) + ((http) + (apply db:multi-db-sync + dbstruct + 'schema + 'killservers + 'adj-target + 'new2old + '(dejunk) + )) + ((tcp nfs) + (debug:print 0 *default-log-port* "WARNING: cleanup-db NOT implemented yet for tcp and nfs.") + #;(apply db:multi-db-sync + dbstruct + 'schema + 'killservers + 'adj-target + 'new2old + '(dejunk) + ))) (if (common:api-changed?) (common:set-last-run-version))) (define (common:snapshot-file filepath #!key (subdir ".") ) (if (file-exists? filepath) Index: dbmod.scm ================================================================== --- dbmod.scm +++ dbmod.scm @@ -356,11 +356,10 @@ ;; done (debug:print 0 *default-log-port* "Attaching "destdbfile" as auxdb") (sqlite3:execute dbh (conc "ATTACH '"destdbfile"' AS auxdb;")) (for-each (lambda (table) - (debug:print 0 *default-log-port* "Syncing table "table) (let* ((tbldat (alist-ref table tables equal?)) (fields (map car tbldat)) (fields-str (string-intersperse fields ",")) (dir (eq? direction 'todest)) (fromdb (if dir "" "auxdb.")) @@ -375,11 +374,11 @@ " SELECT * FROM "fromdb table";")) (stmt4 (conc "DELETE FROM "todb table" WHERE "fromdb table ".last_update > "todb table".last_update;")) (stmt5 (conc "DELETE FROM "todb table";")) (stmt6 (conc "INSERT OR REPLACE INTO "todb table" ("fields-str") SELECT "fields-str" FROM "fromdb table";")) - ) + (start-ms (current-milliseconds))) ;; (if (not (has-last-update dbh table)) ;; (sqlite3:execute dbh (conc "ALTER TABLE "table" ADD COLUMN last_update INTEGER;"))) ;; (if (not (has-last-update dbh (conc "auxdb."table))) ;; (sqlite3:execute dbh (conc "ALTER TABLE auxdb."table" ADD COLUMN last_update INTEGER;"))) (sqlite3:with-transaction @@ -388,12 +387,14 @@ (sqlite3:execute dbh stmt5) ;; (sqlite3:execute dbh stmt4) ;; if it worked this would be better for incremental up ;; (sqlite3:execute dbh stmt1) (sqlite3:execute dbh stmt6) )) - (sqlite3:execute dbh "DETACH auxdb;"))) - table-names))) + (debug:print 0 *default-log-port* "Synced table "table" in "(- (current-milliseconds) start-ms)"ms") + )) + table-names) + (sqlite3:execute dbh "DETACH auxdb;"))) ;; prefix is "" or "auxdb." ;; ;; (define (dbmod:last-update-patch dbh prefix) ;; (let (( Index: server.scm ================================================================== --- server.scm +++ server.scm @@ -516,12 +516,12 @@ (bestadrs (server:get-best-guess-address currhost))) (or (equal? host currhost) (equal? host bestadrs)))))) (case mode ((info) - (print "oldest: "oldest-dat", selected host: "host", all-valid: "all-valid) - (print "youngest: "(hash-table-ref serversdat (car all-valid)))) + (debug:print 0 *default-log-port* "oldest: "oldest-dat", selected host: "host", all-valid: "all-valid) + (debug:print 0 *default-log-port* "youngest: "(hash-table-ref serversdat (car all-valid)))) ((home) host) ((homehost) (cons host (am-home?))) ;; shut up old code ((home?) (am-home?)) ((best-ten)(names->dats (best-ten))) ((all-valid)(names->dats all-valid))