Index: dbmod.scm ================================================================== --- dbmod.scm +++ dbmod.scm @@ -5897,13 +5897,13 @@ (db:with-db dbstruct #f #f (lambda (db) (sqlite3:fold-row - (lambda (res count) - (max res count)) - 0 + (lambda (res . row) + (cons row res)) + '() db "SELECT * FROM servers WHERE apath=?;" apath)))) ) Index: dcommon.scm ================================================================== --- dcommon.scm +++ dcommon.scm @@ -905,11 +905,11 @@ #:numlin-visible 5 )) (colnames (list "Id" "MTver" "Pid" "Host" "Interface:OutPort" "RunTime" "State" "RunId")) (updater (lambda () (if (dashboard:monitor-changed? commondat tabdat) - (let ((servers (rmt:get-servers-info *remotedat* *toppath*)#;(server:get-list *toppath* limit: 10))) + (let ((servers (rmt:get-servers-info *toppath*)#;(server:get-list *toppath* limit: 10))) (iup:attribute-set! servers-matrix "NUMLIN" (length servers)) ;; (set! colnum 0) ;; (for-each (lambda (colname) ;; ;; (print "colnum: " colnum " colname: " colname) ;; (iup:attribute-set! servers-matrix (conc "0:" colnum) colname) Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -1135,11 +1135,11 @@ (if (or (args:get-arg "-list-servers") (args:get-arg "-kill-servers")) (let ((tl (launch:setup))) (if tl ;; all roads from here exit - (let* ((servers (rmt:get-servers-info *remotedat* *toppath*)) + (let* ((servers (rmt:get-servers-info *toppath*)) (fmtstr "~8a~22a~20a~20a~8a\n")) ;; id INTEGER PRIMARY KEY, ;; host TEXT, ;; port INTEGER, ;; servkey TEXT, Index: rmtmod.scm ================================================================== --- rmtmod.scm +++ rmtmod.scm @@ -2225,11 +2225,11 @@ ;; this is our forever loop (let* ((iface (servdat-host *server-info*)) (port (servdat-port *server-info*))) (let loop ((count 0) (bad-sync-count 0) - (start-time (current-process-milliseconds))) + (start-time (current-milliseconds))) (if (and (not is-main) (common:low-noise-print 60 "servdat-status")) (debug:print-info 0 *default-log-port* "servdat-status is " (servdat-status *server-info*))) ;; set up the database handle @@ -2282,18 +2282,18 @@ (mutex-unlock! *heartbeat-mutex*) ;; when things go wrong we don't want to be doing the various ;; queries too often so we strive to run this stuff only every ;; four seconds or so. - (let* ((sync-time (- (current-process-milliseconds) start-time)) + (let* ((sync-time (- (current-milliseconds) start-time)) (rem-time (quotient (- 4000 sync-time) 1000))) (if (and (<= rem-time 4) (> rem-time 0)) (thread-sleep! rem-time))) (if (< count 1) ;; 3x3 = 9 secs aprox - (loop (+ count 1) bad-sync-count (current-process-milliseconds))) + (loop (+ count 1) bad-sync-count (current-milliseconds))) ;; Transfer *db-last-access* to last-access to use in checking that we are still alive (set! last-access *db-last-access*) (if (common:low-noise-print 60 "dbstats") @@ -2313,11 +2313,11 @@ (if is-main ;; do not exit if there are other servers (keep main open until all others gone) (> (rmt:get-count-servers remdat *toppath*) 1) #f))) (if (common:low-noise-print 120 "server continuing") (debug:print-info 0 *default-log-port* "Server continuing, seconds since last db access: " (- (current-seconds) last-access))) - (loop 0 bad-sync-count (current-process-milliseconds))) + (loop 0 bad-sync-count (current-milliseconds))) (else (set! *unclean-shutdown* #f) (debug:print-info 0 *default-log-port* "Server timed out. seconds since last db access: " (- (current-seconds) last-access)) (shutdown-server-sequence port) #;(debug:print-info 0 *default-log-port* "Sending 'quit to server, received: " Index: tests/unittests/server.scm ================================================================== --- tests/unittests/server.scm +++ tests/unittests/server.scm @@ -25,14 +25,15 @@ (import rmtmod trace http-client apimod dbmod launchmod) (trace-call-sites #t) (trace + ;; db:get-dbdat ;; rmt:find-main-server -;; rmt:send-receive-real -;; rmt:send-receive + ;; rmt:send-receive-real + ;; rmt:send-receive ;; sexpr->string ;; server-ready? ;; rmt:register-server ;; rmt:deregister-server ;; rmt:open-main-connection