|
@@ -89,22 +89,16 @@
|
|
|
:disable-web-preview 1)))
|
|
:disable-web-preview 1)))
|
|
|
|
|
|
|
|
|
|
|
|
|
-(defvar *crons* (list
|
|
|
|
|
- (list #'process-latest-akb '(:minute * :hour *)))
|
|
|
|
|
- "List of cron functions with their schedules")
|
|
|
|
|
-(defvar *cron-timers* nil)
|
|
|
|
|
-
|
|
|
|
|
(defun start ()
|
|
(defun start ()
|
|
|
(mapc #'sb-ext:unschedule-timer (trivial-timers:list-all-timers))
|
|
(mapc #'sb-ext:unschedule-timer (trivial-timers:list-all-timers))
|
|
|
- (setf *cron-timers*
|
|
|
|
|
- (loop for (function schedule) in *crons*
|
|
|
|
|
- do (log:info "Starting cron" function schedule)
|
|
|
|
|
- collect
|
|
|
|
|
- (clon:schedule-function
|
|
|
|
|
- (lambda () (funcall function))
|
|
|
|
|
- (clon:make-scheduler
|
|
|
|
|
- (apply #'clon:make-typed-cron-schedule schedule)
|
|
|
|
|
- :allow-now-p t)
|
|
|
|
|
- :thread t)))
|
|
|
|
|
- (loop
|
|
|
|
|
- do (process-updates)))
|
|
|
|
|
|
|
+ (clon:schedule-function
|
|
|
|
|
+ (lambda () (process-latest-akb))
|
|
|
|
|
+ (clon:make-scheduler
|
|
|
|
|
+ (clon:make-typed-cron-schedule :minute '* :hour '*)
|
|
|
|
|
+ :allow-now-p t)
|
|
|
|
|
+ :thread t)
|
|
|
|
|
+ (bordeaux-threads:make-thread
|
|
|
|
|
+ (lambda ()
|
|
|
|
|
+ (loop
|
|
|
|
|
+ do (process-updates)))
|
|
|
|
|
+ :name "process-updates"))
|