248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
|
(loop 0))
(begin
(debug:print-info 0 "Starting to shutdown the server.")
;; need to delete only *my* server entry (future use)
(set! *time-to-exit* #t)
(tasks:server-deregister-self tdb (get-host-name))
(thread-sleep! 1)
(debug:print-info 0 "Max cached queries was " *max-cache-size*)
(debug:print-info 0 "Server shutdown complete. Exiting")
(exit)))))))
;; all routes though here end in exit ...
(define (http-transport:launch)
(if (not *toppath*)
(if (not (setup-for-run))
|
|
>
>
|
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
|
(loop 0))
(begin
(debug:print-info 0 "Starting to shutdown the server.")
;; need to delete only *my* server entry (future use)
(set! *time-to-exit* #t)
(tasks:server-deregister-self tdb (get-host-name))
(thread-sleep! 1)
(debug:print-info 0 "Max cached queries was " *max-cache-size*)
(debug:print-info 0 "Number of cached writes " *number-of-writes*)
(debug:print-info 0 "Average cached write time " (/ *writes-total-delay* *number-of-writes*) " ms")
(debug:print-info 0 "Server shutdown complete. Exiting")
(exit)))))))
;; all routes though here end in exit ...
(define (http-transport:launch)
(if (not *toppath*)
(if (not (setup-for-run))
|
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
|
(debug:print-info 2 "NOT starting new server, one is already running on " (vector-ref hostinfo 1) ":" (vector-ref hostinfo 2))
(if *toppath*
(let* ((th2 (make-thread (lambda ()
(http-transport:run
(if (args:get-arg "-server")
(args:get-arg "-server")
"-"))) "Server run"))
(th3 (make-thread (lambda ()(http-transport:keep-running)) "Keep running")))
(thread-start! th2)
(thread-start! th3)
(set! *didsomething* #t)
(thread-join! th2))
(debug:print 0 "ERROR: Failed to setup for megatest")))
(exit)))
(define (http-transport:server-signal-handler signum)
(handle-exceptions
|
|
>
>
|
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
|
(debug:print-info 2 "NOT starting new server, one is already running on " (vector-ref hostinfo 1) ":" (vector-ref hostinfo 2))
(if *toppath*
(let* ((th2 (make-thread (lambda ()
(http-transport:run
(if (args:get-arg "-server")
(args:get-arg "-server")
"-"))) "Server run"))
(th3 (make-thread http-transport:keep-running "Keep running"))
(th1 (make-thread server:write-queue-handler "write queue")))
(thread-start! th2)
(thread-start! th3)
(thread-start! th1)
(set! *didsomething* #t)
(thread-join! th2))
(debug:print 0 "ERROR: Failed to setup for megatest")))
(exit)))
(define (http-transport:server-signal-handler signum)
(handle-exceptions
|