Add job status endpoint, persist lastJobId; replace in-process queue with BullMQ-based queue and worker; link job status in UI
This commit is contained in:
@@ -27,6 +27,7 @@ export async function action({ request }: { request: Request }) {
|
||||
const lastDecision = formData.get("lastDecision")?.toString();
|
||||
const lastExplanation = formData.get("lastExplanation")?.toString();
|
||||
const lastExecutionPlan = formData.get("lastExecutionPlan")?.toString();
|
||||
const lastJobId = formData.get("lastJobId")?.toString();
|
||||
|
||||
// Upsert the stock record so ticker is ensured and optional fields are saved
|
||||
const stock = await db.stock.upsert({
|
||||
@@ -35,12 +36,14 @@ export async function action({ request }: { request: Request }) {
|
||||
lastDecision: lastDecision ?? undefined,
|
||||
lastExplanation: lastExplanation ?? undefined,
|
||||
lastExecutionPlan: lastExecutionPlan ?? undefined,
|
||||
lastJobId: lastJobId ?? undefined,
|
||||
},
|
||||
create: {
|
||||
ticker,
|
||||
lastDecision: lastDecision ?? undefined,
|
||||
lastExplanation: lastExplanation ?? undefined,
|
||||
lastExecutionPlan: lastExecutionPlan ?? undefined,
|
||||
lastJobId: lastJobId ?? undefined,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user