diff --git a/custom_routes.py b/custom_routes.py index a6d66c2..99c4c1e 100644 --- a/custom_routes.py +++ b/custom_routes.py @@ -203,7 +203,10 @@ async def send_json_override(self, event, data, sid=None): prompt_id = data.get('prompt_id') # now we send everything - await asyncio.wait([send(event, data), self.send_json_original(event, data, sid)]) + await asyncio.wait([ + asyncio.create_task(send(event, data)), + asyncio.create_task(self.send_json_original(event, data, sid)) + ]) if event == 'execution_start': update_run(prompt_id, Status.RUNNING) diff --git a/web/src/routes/registerGetWorkflow.ts b/web/src/routes/registerGetWorkflow.ts index be17571..ca682da 100644 --- a/web/src/routes/registerGetWorkflow.ts +++ b/web/src/routes/registerGetWorkflow.ts @@ -1,8 +1,9 @@ -import { workflowVersionSchema } from "@/db/schema"; +import { workflowVersionSchema, workflowVersionTable } from "@/db/schema"; import type { App } from "@/routes/app"; import { authError } from "@/routes/authError"; import { getWorkflowVersion } from "@/server/crudWorkflow"; import { z, createRoute } from "@hono/zod-openapi"; +import { createSelectSchema } from "drizzle-zod"; const route = createRoute({ method: "get", @@ -19,7 +20,20 @@ const route = createRoute({ 200: { content: { "application/json": { - schema: workflowVersionSchema, + schema: createSelectSchema(workflowVersionTable, { + workflow_api: (schema) => + schema.workflow_api.openapi({ + type: "object", + }), + workflow: (schema) => + schema.workflow.openapi({ + type: "object", + }), + snapshot: (schema) => + schema.snapshot.openapi({ + type: "object", + }), + }), }, }, description: "Retrieve the output",