mirror of
https://github.com/logseq/logseq.git
synced 2026-05-24 20:54:09 +00:00
debug
This commit is contained in:
9
deps/workers/src/logseq/agents/do.cljs
vendored
9
deps/workers/src/logseq/agents/do.cljs
vendored
@@ -373,12 +373,9 @@
|
||||
(p/let [current-session (<get-session self)]
|
||||
(when (= session-id (:id current-session))
|
||||
(let [event-type (or (:type payload) "agent.runtime")]
|
||||
(p/let [_ (<append-event! self {:type event-type
|
||||
:data payload
|
||||
:ts (common/now-ms)})
|
||||
current-session (<get-session self)]
|
||||
(when (runtime-auto-terminate-status? (:status current-session))
|
||||
(<terminate-runtime! self (:runtime current-session))))))))
|
||||
(<append-event! self {:type event-type
|
||||
:data payload
|
||||
:ts (common/now-ms)})))))
|
||||
|
||||
(defn- <consume-events-stream! [^js self session-id runtime on-ready]
|
||||
(let [provider (runtime-provider/resolve-provider (.-env self) runtime)]
|
||||
|
||||
@@ -1083,19 +1083,8 @@
|
||||
(str "/v1/sessions/" session-id "/terminate")
|
||||
{:token agent-token}))
|
||||
|
||||
(defn- <cloudflare-delete-sandbox! [^js sandbox]
|
||||
(cond
|
||||
(js-method sandbox "delete")
|
||||
(->promise (.delete sandbox))
|
||||
|
||||
(js-method sandbox "remove")
|
||||
(->promise (.remove sandbox))
|
||||
|
||||
(js-method sandbox "destroy")
|
||||
(->promise (.destroy sandbox))
|
||||
|
||||
:else
|
||||
(p/resolved nil)))
|
||||
(defn- <cloudflare-destroy-sandbox! [^js sandbox]
|
||||
(->promise (.destroy sandbox)))
|
||||
|
||||
(defn- <cloudflare-open-terminal!
|
||||
[^js env runtime request {:keys [cols rows]}]
|
||||
@@ -1474,8 +1463,8 @@
|
||||
(p/catch
|
||||
(<cloudflare-terminate-session! sandbox port agent-token session-id)
|
||||
(fn [_] nil)))
|
||||
_ (p/catch (<cloudflare-delete-sandbox! sandbox)
|
||||
(fn [_] nil))]
|
||||
result (<cloudflare-destroy-sandbox! sandbox)]
|
||||
(log/info ::destroy-sandbox-result result)
|
||||
nil)
|
||||
(fn [_] nil)))))))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user