397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
|
(tasks:server-set-state! (db:delay-if-busy tdbdat) server-id "dbprep")
;;(BB> "http-transport: ->dbprep")
(thread-sleep! 0.5) ;; give some margin for queries to complete before switching from file based access to server based access
(set! *dbstruct-db* (db:setup)) ;; run-id))
(set! server-going #t)
(tasks:server-set-state! (db:delay-if-busy tdbdat) server-id "running")
;;(BB> "http-transport: ->running")
(server:write-dotserver *toppath* (conc iface ":" port))
(thread-start! *watchdog*)
(server:complete-attempt *toppath*))
(begin ;; gotta exit nicely
;;(BB> "http-transport: ->collision")
(tasks:server-set-state! (db:delay-if-busy tdbdat) server-id "collision")
(http-transport:server-shutdown server-id port))))))
|
|
|
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
|
(tasks:server-set-state! (db:delay-if-busy tdbdat) server-id "dbprep")
;;(BB> "http-transport: ->dbprep")
(thread-sleep! 0.5) ;; give some margin for queries to complete before switching from file based access to server based access
(set! *dbstruct-db* (db:setup)) ;; run-id))
(set! server-going #t)
(tasks:server-set-state! (db:delay-if-busy tdbdat) server-id "running")
;;(BB> "http-transport: ->running")
(server:write-dotserver *toppath* iface port (current-process-id) 'http)
(thread-start! *watchdog*)
(server:complete-attempt *toppath*))
(begin ;; gotta exit nicely
;;(BB> "http-transport: ->collision")
(tasks:server-set-state! (db:delay-if-busy tdbdat) server-id "collision")
(http-transport:server-shutdown server-id port))))))
|
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
|
(current-seconds)))
(begin
(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)))
;;
;; Consider implementing some smarts here to re-insert the record or kill self is
;; the db indicates so
;;
;; (if (tasks:server-am-i-the-server? tdb run-id)
;; (tasks:server-set-state! tdb server-id "running"))
;;
(loop 0 server-state bad-sync-count (current-milliseconds)))
(http-transport:server-shutdown server-id port))))))
;; code cut out from above
|
|
>
>
>
>
>
>
|
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
|
(current-seconds)))
(begin
(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)))
;;
;; Consider implementing some smarts here to re-insert the record or kill self is
;; the db indicates so
;;
;; BB - added this because servers are hanging about, alive and well
;; but in defunctdefault state in tdb and a .server file
;; preventing replacement servers from starting.
(tasks:server-set-state! (db:delay-if-busy tdbdat) server-id "running")
;;
;; (if (tasks:server-am-i-the-server? tdb run-id)
;; (tasks:server-set-state! tdb server-id "running"))
;;
(loop 0 server-state bad-sync-count (current-milliseconds)))
(http-transport:server-shutdown server-id port))))))
;; code cut out from above
|