working notifications across backend and frontend

This commit is contained in:
2025-08-25 15:22:24 +01:00
parent ec7bd469f9
commit 3a182fc49b
5 changed files with 89 additions and 16 deletions

View File

@@ -237,6 +237,11 @@ func ListenNewStackEvents(db *sql.DB) {
return
}
if err := stackModel.EndProcessing(ctx, stackID); err != nil {
newStacksLogger.Error("failed to finish processing", "error", err)
return
}
newStacksLogger.Debug("Finished processing stack", "StackID", stackID)
}()
}

View File

@@ -121,6 +121,16 @@ func (m ListModel) StartProcessing(ctx context.Context, processingListID uuid.UU
return err
}
func (m ListModel) EndProcessing(ctx context.Context, processingListID uuid.UUID) error {
startProcessingStmt := ProcessingLists.
UPDATE(ProcessingLists.Status).
SET(model.Progress_Complete).
WHERE(ProcessingLists.ID.EQ(UUID(processingListID)))
_, err := startProcessingStmt.ExecContext(ctx, m.dbPool)
return err
}
// ========================================
// INSERT methods
// ========================================