|
105 | 105 |
|
106 | 106 | (defn <rtc-start!
|
107 | 107 | [repo & {:keys [stop-before-start?] :or {stop-before-start? true}}]
|
108 |
| - (when-let [graph-uuid (ldb/get-graph-rtc-uuid (db/get-db repo))] |
109 |
| - (p/do! |
110 |
| - (js/Promise. user-handler/task--ensure-id&access-token) |
111 |
| - (p/let [start-ex (state/<invoke-db-worker :thread-api/rtc-start stop-before-start?) |
112 |
| - ex-data* (ex-data start-ex) |
113 |
| - _ (case (:type ex-data*) |
114 |
| - (:rtc.exception/not-rtc-graph |
115 |
| - :rtc.exception/not-found-db-conn) |
116 |
| - (notification/show! (ex-message start-ex) :error) |
| 108 | + (let [db (db/get-db repo) |
| 109 | + graph-uuid (ldb/get-graph-rtc-uuid db)] |
| 110 | + (if-not graph-uuid |
| 111 | + (log/error :<rtc-start! ["graph-uuid not found" repo]) |
| 112 | + (p/do! |
| 113 | + (js/Promise. user-handler/task--ensure-id&access-token) |
| 114 | + (p/let [start-ex (state/<invoke-db-worker :thread-api/rtc-start stop-before-start?) |
| 115 | + ex-data* (ex-data start-ex) |
| 116 | + _ (case (:type ex-data*) |
| 117 | + (:rtc.exception/not-rtc-graph |
| 118 | + :rtc.exception/not-found-db-conn) |
| 119 | + (notification/show! (ex-message start-ex) :error) |
117 | 120 |
|
118 |
| - :rtc.exception/major-schema-version-mismatched |
119 |
| - (case (:sub-type ex-data*) |
120 |
| - :download |
121 |
| - (notification-download-higher-schema-graph! repo graph-uuid (:remote ex-data*)) |
122 |
| - :create-branch |
123 |
| - (notification-upload-higher-schema-graph! repo) |
124 |
| - ;; else |
125 |
| - (do (log/info :start-ex start-ex) |
126 |
| - (notification/show! [:div |
127 |
| - [:div (ex-message start-ex)] |
128 |
| - [:div (-> ex-data* |
129 |
| - (select-keys [:app :local :remote]) |
130 |
| - pp/pprint |
131 |
| - with-out-str)]] |
132 |
| - :error))) |
| 121 | + :rtc.exception/major-schema-version-mismatched |
| 122 | + (case (:sub-type ex-data*) |
| 123 | + :download |
| 124 | + (notification-download-higher-schema-graph! repo graph-uuid (:remote ex-data*)) |
| 125 | + :create-branch |
| 126 | + (notification-upload-higher-schema-graph! repo) |
| 127 | + ;; else |
| 128 | + (do (log/info :start-ex start-ex) |
| 129 | + (notification/show! [:div |
| 130 | + [:div (ex-message start-ex)] |
| 131 | + [:div (-> ex-data* |
| 132 | + (select-keys [:app :local :remote]) |
| 133 | + pp/pprint |
| 134 | + with-out-str)]] |
| 135 | + :error))) |
133 | 136 |
|
134 |
| - :rtc.exception/lock-failed nil |
| 137 | + :rtc.exception/lock-failed nil |
135 | 138 |
|
136 |
| - ;; else |
137 |
| - nil)] |
138 |
| - nil)))) |
| 139 | + ;; else |
| 140 | + nil)] |
| 141 | + nil))) |
| 142 | + |
| 143 | + )) |
139 | 144 |
|
140 | 145 | (defn <get-remote-graphs
|
141 | 146 | []
|
|
0 commit comments