|
|
@@ -105,42 +105,39 @@
|
|
|
|
|
|
(defn <rtc-start!
|
|
|
[repo & {:keys [stop-before-start?] :or {stop-before-start? true}}]
|
|
|
- (let [db (db/get-db repo)
|
|
|
- graph-uuid (ldb/get-graph-rtc-uuid db)]
|
|
|
+ (p/let [graph-uuid (state/<invoke-db-worker :thread-api/get-rtc-graph-uuid repo)]
|
|
|
(if-not graph-uuid
|
|
|
(log/info :skip-<rtc-start! ["graph-uuid not found" repo])
|
|
|
(p/do!
|
|
|
- (js/Promise. user-handler/task--ensure-id&access-token)
|
|
|
- (p/let [start-ex (state/<invoke-db-worker :thread-api/rtc-start stop-before-start?)
|
|
|
- ex-data* (ex-data start-ex)
|
|
|
- _ (case (:type ex-data*)
|
|
|
- (:rtc.exception/not-rtc-graph
|
|
|
- :rtc.exception/not-found-db-conn)
|
|
|
- (notification/show! (ex-message start-ex) :error)
|
|
|
+ (js/Promise. user-handler/task--ensure-id&access-token)
|
|
|
+ (p/let [start-ex (state/<invoke-db-worker :thread-api/rtc-start stop-before-start?)
|
|
|
+ ex-data* (ex-data start-ex)
|
|
|
+ _ (case (:type ex-data*)
|
|
|
+ (:rtc.exception/not-rtc-graph
|
|
|
+ :rtc.exception/not-found-db-conn)
|
|
|
+ (notification/show! (ex-message start-ex) :error)
|
|
|
|
|
|
- :rtc.exception/major-schema-version-mismatched
|
|
|
- (case (:sub-type ex-data*)
|
|
|
- :download
|
|
|
- (notification-download-higher-schema-graph! repo graph-uuid (:remote ex-data*))
|
|
|
- :create-branch
|
|
|
- (notification-upload-higher-schema-graph! repo)
|
|
|
+ :rtc.exception/major-schema-version-mismatched
|
|
|
+ (case (:sub-type ex-data*)
|
|
|
+ :download
|
|
|
+ (notification-download-higher-schema-graph! repo graph-uuid (:remote ex-data*))
|
|
|
+ :create-branch
|
|
|
+ (notification-upload-higher-schema-graph! repo)
|
|
|
;; else
|
|
|
- (do (log/info :start-ex start-ex)
|
|
|
- (notification/show! [:div
|
|
|
- [:div (ex-message start-ex)]
|
|
|
- [:div (-> ex-data*
|
|
|
- (select-keys [:app :local :remote])
|
|
|
- pp/pprint
|
|
|
- with-out-str)]]
|
|
|
- :error)))
|
|
|
+ (do (log/info :start-ex start-ex)
|
|
|
+ (notification/show! [:div
|
|
|
+ [:div (ex-message start-ex)]
|
|
|
+ [:div (-> ex-data*
|
|
|
+ (select-keys [:app :local :remote])
|
|
|
+ pp/pprint
|
|
|
+ with-out-str)]]
|
|
|
+ :error)))
|
|
|
|
|
|
- :rtc.exception/lock-failed nil
|
|
|
+ :rtc.exception/lock-failed nil
|
|
|
|
|
|
;; else
|
|
|
- nil)]
|
|
|
- nil)))
|
|
|
-
|
|
|
- ))
|
|
|
+ nil)]
|
|
|
+ nil)))))
|
|
|
|
|
|
(defn <get-remote-graphs
|
|
|
[]
|