Browse Source

[cron] revert per-cron-thread and random-state storage

OLIVER 8 năm trước cách đây
mục cha
commit
fa85860cdb
1 tập tin đã thay đổi với 7 bổ sung7 xóa
  1. 7 7
      macros.lisp

+ 7 - 7
macros.lisp

@@ -137,11 +137,12 @@
         (scheduler (symbol-append name '-scheduler)))
     `(progn
        (defun ,name ()
-         (with-random-state
-           (unwind-protect
-                (handler-case (progn ,@body)
-                  (error (e) (log:error "~A" e)))
-             (dex:clear-connection-pool))))
+	 (unwind-protect
+	      (handler-case
+		  (let ((*random-state* (make-random-state t)))
+		    ,@body)
+		(error (e) (log:error "~A" e)))
+	   (dex:clear-connection-pool)))
        (defun ,scheduler ()
          (clon:schedule-function
           ',name (clon:make-scheduler
@@ -149,7 +150,6 @@
                    ,@schedule)
                   :allow-now-p t)
           :name ',name
-          :thread (bt:make-thread (lambda () (loop (sleep 1)))
-                                  :name (format nil "Sleeper '~A'" (symbol-name ',name))))
+          :thread t)
          (values))
        (add-hook :starting ',scheduler))))