0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-09 08:38:15 -05:00

💄 Minor cosmetic changes.

This commit is contained in:
Andrey Antukh 2020-05-14 14:26:12 +02:00 committed by Alonso Torres
parent 5a03c13731
commit 4b31a147a9
3 changed files with 12 additions and 12 deletions

View file

@ -152,7 +152,9 @@
(defn disconnect! (defn disconnect!
[conn] [conn]
(.. conn (getSession) (disconnect))) (let [session (.getSession conn)]
(when session
(.disconnect session))))
(defn- on-subscribed (defn- on-subscribed
[{:keys [conn] :as ws}] [{:keys [conn] :as ws}]

View file

@ -23,14 +23,6 @@
[uxbox.tasks.impl :as impl] [uxbox.tasks.impl :as impl]
[uxbox.util.time :as dt])) [uxbox.util.time :as dt]))
;; --- Public API
(defn schedule!
([opts] (schedule! db/pool opts))
([conn opts]
(s/assert ::impl/task-options opts)
(impl/schedule! conn opts)))
;; --- State initialization ;; --- State initialization
;; TODO: missing self maintanance task; when the queue table is full ;; TODO: missing self maintanance task; when the queue table is full
@ -48,6 +40,14 @@
:start (impl/start-worker! {:tasks tasks}) :start (impl/start-worker! {:tasks tasks})
:stop (impl/stop! worker)) :stop (impl/stop! worker))
;; --- Public API
(defn schedule!
([opts] (schedule! db/pool opts))
([conn opts]
(s/assert ::impl/task-options opts)
(impl/schedule! conn opts)))
;; (defstate scheduler ;; (defstate scheduler
;; :start (impl/start-scheduler! tasks) ;; :start (impl/start-scheduler! tasks)
;; :stop (impl/stop! tasks-worker)) ;; :stop (impl/stop! tasks-worker))

View file

@ -153,9 +153,7 @@
(defn start-worker! (defn start-worker!
[options] [options]
(let [stop (a/chan)] (let [stop (a/chan)]
(a/go (start-worker-eventloop! (assoc options ::stop stop))
(a/<! (start-worker-eventloop! (assoc options ::stop stop)))
(log/info "STOPING"))
(->Worker stop))) (->Worker stop)))
(defn stop! (defn stop!