279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
|
(or (configf:lookup (megatest:area-configdat area-dat) "setup" "testsuite" )
(pathname-file (megatest:area-path area-dat))))
;;======================================================================
;; E X I T H A N D L I N G
;;======================================================================
(define (std-exit-procedure area-dat)
(let* ((no-hurry (if *time-to-exit* ;; hurry up
#f
(begin
(set! *time-to-exit* #t)
#t)))
(configdat (megatest:area-configdat area-dat))
(run-ids (hash-table-keys *db-local-sync*)))
(debug:print-info 4 "starting exit process, finalizing databases.")
|
>
>
>
>
>
>
>
>
>
>
>
|
|
|
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
|
(or (configf:lookup (megatest:area-configdat area-dat) "setup" "testsuite" )
(pathname-file (megatest:area-path area-dat))))
;;======================================================================
;; E X I T H A N D L I N G
;;======================================================================
(define (common:legacy-sync-recommended)
(or (args:get-arg "-runtests")
(args:get-arg "-server")
(args:get-arg "-set-run-status")
(args:get-arg "-remove-runs")
(args:get-arg "-get-run-status")
))
(define (common:legacy-sync-required)
(configf:lookup *configdat* "setup" "megatest-db"))
(define (std-exit-procedure)
(let ((no-hurry (if *time-to-exit* ;; hurry up
#f
(begin
(set! *time-to-exit* #t)
#t)))
(configdat (megatest:area-configdat area-dat))
(run-ids (hash-table-keys *db-local-sync*)))
(debug:print-info 4 "starting exit process, finalizing databases.")
|
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
|
(sqlite3:interrupt! db)
(sqlite3:finalize! db #t)
(vector-set! *task-db* 0 #f)))))) "Cleanup db exit thread"))
(th2 (make-thread (lambda ()
(debug:print 4 "Attempting clean exit. Please be patient and wait a few seconds...")
(if no-hurry
(thread-sleep! 5) ;; give the clean up few seconds to do it's stuff
(thread-sleep! 1))
(debug:print 0 " Done.")
)
"clean exit")))
(thread-start! th2)
(thread-start! th1)
(thread-join! th2))))
(define (std-signal-handler signum)
;; (signal-mask! signum)
(set! *time-to-exit* #t)
(debug:print 0 "ERROR: Received signal " signum " exiting promptly")
;; (std-exit-procedure) ;; shouldn't need this since we are exiting and it will be called anyway
(exit))
|
|
|
|
|
|
|
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
|
(sqlite3:interrupt! db)
(sqlite3:finalize! db #t)
(vector-set! *task-db* 0 #f)))))) "Cleanup db exit thread"))
(th2 (make-thread (lambda ()
(debug:print 4 "Attempting clean exit. Please be patient and wait a few seconds...")
(if no-hurry
(thread-sleep! 5) ;; give the clean up few seconds to do it's stuff
(thread-sleep! 2))
(debug:print 4 " ... done")
)
"clean exit")))
(thread-start! th1)
(thread-start! th2)
(thread-join! th1))))
(define (std-signal-handler signum)
;; (signal-mask! signum)
(set! *time-to-exit* #t)
(debug:print 0 "ERROR: Received signal " signum " exiting promptly")
;; (std-exit-procedure) ;; shouldn't need this since we are exiting and it will be called anyway
(exit))
|