Index: common.scm ================================================================== --- common.scm +++ common.scm @@ -209,18 +209,18 @@ (debug:print-info 4 *default-log-port* "starting exit process, finalizing databases.") (if (and no-hurry (debug:debug-mode 18)) (rmt:print-db-stats)) (let ((th1 (make-thread (lambda () ;; thread for cleaning up, give it five seconds (if *dbstruct-db* (db:close-all *dbstruct-db*)) ;; one second allocated - (if *task-db* - (let ((db (cdr *task-db*))) + (if (bdat-task-db *bdat*) + (let ((db (cdr (bdat-task-db *bdat*)))) (if (sqlite3:database? db) (begin (sqlite3:interrupt! db) (sqlite3:finalize! db #t) - ;; (vector-set! *task-db* 0 #f) - (set! *task-db* #f))))) + ;; (vector-set! (bdat-task-db *bdat*) 0 #f) + (bdat-task-db-set! *bdat* #f))))) (http-client#close-idle-connections!) ;; (if (and *runremote* ;; (remote-conndat *runremote*)) ;; (begin ;; (http-client#close-all-connections!))) ;; for http-client Index: commonmod.scm ================================================================== --- commonmod.scm +++ commonmod.scm @@ -107,11 +107,12 @@ (defstruct bdat (home (getenv "HOME")) (user (getenv "USER")) (watchdog #f) (time-to-exit #f) - (server-loop-heart-beat (current-seconds)) + (task-db #f) + ;; (server-loop-heart-beat (current-seconds)) ) (define (make-and-init-bigdata) (set! *bdat* (make-bdat))) Index: tasksmod.scm ================================================================== --- tasksmod.scm +++ tasksmod.scm @@ -151,12 +151,12 @@ ;; ==> open in-mem version ;; If file NOT exists ;; ==> open in-mem version ;; (define (tasks:open-db #!key (numretries 4)) - (if *task-db* - *task-db* + (if (bdat-task-db *bdat*) + (bdat-task-db *bdat*) (handle-exceptions exn (if (> numretries 0) (begin (print-call-chain (current-error-port)) @@ -231,12 +231,12 @@ login_time TIMESTAMP, logout_time TIMESTAMP DEFAULT -1, CONSTRAINT clients_constraint UNIQUE (pid,hostname));") ;)) - (set! *task-db* (cons mdb dbpath)) - *task-db*)))) + (bdat-task-db-set! *bdat* (cons mdb dbpath)) + (bdat-task-db *bdat*))))) ;;====================================================================== ;; Server and client management ;;======================================================================