Spaces:
Running
Running
Do not "execute" workspaces with no executor.
Browse files
lynxkite-app/src/lynxkite_app/crdt.py
CHANGED
|
@@ -264,6 +264,8 @@ async def execute(name: str, ws_crdt: pycrdt.Map, ws_pyd: workspace.Workspace, d
|
|
| 264 |
assert path.is_relative_to(cwd), "Provided workspace path is invalid"
|
| 265 |
# Save user changes before executing, in case the execution fails.
|
| 266 |
workspace.save(ws_pyd, path)
|
|
|
|
|
|
|
| 267 |
ops.load_user_scripts(name)
|
| 268 |
ws_pyd._crdt = ws_crdt
|
| 269 |
with ws_crdt.doc.transaction():
|
|
|
|
| 264 |
assert path.is_relative_to(cwd), "Provided workspace path is invalid"
|
| 265 |
# Save user changes before executing, in case the execution fails.
|
| 266 |
workspace.save(ws_pyd, path)
|
| 267 |
+
if not workspace.has_executor(ws_pyd):
|
| 268 |
+
return
|
| 269 |
ops.load_user_scripts(name)
|
| 270 |
ws_pyd._crdt = ws_crdt
|
| 271 |
with ws_crdt.doc.transaction():
|
lynxkite-core/src/lynxkite/core/workspace.py
CHANGED
|
@@ -119,9 +119,12 @@ class Workspace(BaseConfig):
|
|
| 119 |
return self.model_copy(update={"edges": edges})
|
| 120 |
|
| 121 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
async def execute(ws: Workspace):
|
| 123 |
-
|
| 124 |
-
await ops.EXECUTORS[ws.env](ws)
|
| 125 |
|
| 126 |
|
| 127 |
def save(ws: Workspace, path: str):
|
|
|
|
| 119 |
return self.model_copy(update={"edges": edges})
|
| 120 |
|
| 121 |
|
| 122 |
+
def has_executor(ws: Workspace):
|
| 123 |
+
return ws.env in ops.EXECUTORS
|
| 124 |
+
|
| 125 |
+
|
| 126 |
async def execute(ws: Workspace):
|
| 127 |
+
await ops.EXECUTORS[ws.env](ws)
|
|
|
|
| 128 |
|
| 129 |
|
| 130 |
def save(ws: Workspace, path: str):
|