projects
/
candle
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Handle shutdown gracefully
[candle]
/
src
/
main
/
aws
/
aws.lisp
diff --git
a/src/main/aws/aws.lisp
b/src/main/aws/aws.lisp
index 1d3745b27cd59886ad20722d5332710c0ca5b3ad..2913d3244492dc5f9ca8c259c2ad4a8eff6c521b 100644
(file)
--- a/
src/main/aws/aws.lisp
+++ b/
src/main/aws/aws.lisp
@@
-26,6
+26,7
@@
(values-list retn))))
(defun start-shutdown-thread ()
(values-list retn))))
(defun start-shutdown-thread ()
+ (format t "Starting AWS shutdown thread~%")
(sb-thread:make-thread
(lambda ()
(loop
(sb-thread:make-thread
(lambda ()
(loop
@@
-40,6
+41,12
@@
(sleep 30)))
:name "AWS Shutdown Thread"))
(sleep 30)))
:name "AWS Shutdown Thread"))
+(defmethod candle:shutdown-system ((job-system (eql :aws)))
+ (format t "Shutting down AWS box for exit~%")
+ ; If there's a job going, we need to wait for it to finish
+ (sb-thread:with-mutex (*aws-mutex*))
+ (stop-aws-box))
+
(defun aws-command (cmd &rest args)
(with-output-to-string (out)
(sb-ext:run-program
(defun aws-command (cmd &rest args)
(with-output-to-string (out)
(sb-ext:run-program