|
@@ -563,6 +563,15 @@
|
|
|
period))) ;; Update last-id, next-fetch and period
|
|
period))) ;; Update last-id, next-fetch and period
|
|
|
(error (e) (log:error "~A" e))))
|
|
(error (e) (log:error "~A" e))))
|
|
|
|
|
|
|
|
|
|
+(defun process-watchdog ()
|
|
|
|
|
+ (ignore-errors
|
|
|
|
|
+ (close
|
|
|
|
|
+ (open (merge-pathnames ".watchdog"
|
|
|
|
|
+ (asdf:component-pathname
|
|
|
|
|
+ (asdf:find-system '#:chatikbot)))
|
|
|
|
|
+ :direction :output
|
|
|
|
|
+ :if-exists :supersede
|
|
|
|
|
+ :if-does-not-exist :create)))))
|
|
|
|
|
|
|
|
(defvar *save-settings-lock* (bordeaux-threads:make-lock "save-settings-lock")
|
|
(defvar *save-settings-lock* (bordeaux-threads:make-lock "save-settings-lock")
|
|
|
"Lock for multithreading access to write settings file")
|
|
"Lock for multithreading access to write settings file")
|
|
@@ -586,7 +595,8 @@
|
|
|
process-latest-checkins
|
|
process-latest-checkins
|
|
|
process-rates
|
|
process-rates
|
|
|
process-feeds
|
|
process-feeds
|
|
|
- process-walls) "Enabled schedules")
|
|
|
|
|
|
|
+ process-walls
|
|
|
|
|
+ process-watchdog) "Enabled schedules")
|
|
|
|
|
|
|
|
(defun start ()
|
|
(defun start ()
|
|
|
;; Clear prev threads
|
|
;; Clear prev threads
|
|
@@ -626,4 +636,8 @@
|
|
|
;; Start getUpdates thread
|
|
;; Start getUpdates thread
|
|
|
(bordeaux-threads:make-thread
|
|
(bordeaux-threads:make-thread
|
|
|
(lambda () (loop-with-error-backoff #'process-updates))
|
|
(lambda () (loop-with-error-backoff #'process-updates))
|
|
|
- :name "process-updates"))
|
|
|
|
|
|
|
+ :name "process-updates")
|
|
|
|
|
+
|
|
|
|
|
+ ;; Notify admins
|
|
|
|
|
+ (dolist (admin *admins*)
|
|
|
|
|
+ (telegram-send-message admin (format nil "chatikbot started at ~A" (format-ts (local-time:now))))))
|