diff --git a/backend/src/uxbox/services/notifications.clj b/backend/src/uxbox/services/notifications.clj index 89ecedf29..9d5b295eb 100644 --- a/backend/src/uxbox/services/notifications.clj +++ b/backend/src/uxbox/services/notifications.clj @@ -152,7 +152,9 @@ (defn disconnect! [conn] - (.. conn (getSession) (disconnect))) + (let [session (.getSession conn)] + (when session + (.disconnect session)))) (defn- on-subscribed [{:keys [conn] :as ws}] diff --git a/backend/src/uxbox/tasks.clj b/backend/src/uxbox/tasks.clj index f96db0cf7..4108a59d0 100644 --- a/backend/src/uxbox/tasks.clj +++ b/backend/src/uxbox/tasks.clj @@ -23,14 +23,6 @@ [uxbox.tasks.impl :as impl] [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 ;; TODO: missing self maintanance task; when the queue table is full @@ -48,6 +40,14 @@ :start (impl/start-worker! {:tasks tasks}) :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 ;; :start (impl/start-scheduler! tasks) ;; :stop (impl/stop! tasks-worker)) diff --git a/backend/src/uxbox/tasks/impl.clj b/backend/src/uxbox/tasks/impl.clj index dc61c4f14..249a8bf64 100644 --- a/backend/src/uxbox/tasks/impl.clj +++ b/backend/src/uxbox/tasks/impl.clj @@ -153,9 +153,7 @@ (defn start-worker! [options] (let [stop (a/chan)] - (a/go - (a/Worker stop))) (defn stop!