mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2026-05-07 18:39:17 -05:00
refactor: remove foreign keys from unchanged/non-cascading parent tables (#918)
* refactor: remove fks from unchanged/non-cascading parent tables * fix: cleanup cache for engine repository * fix: remove streamevent
This commit is contained in:
@@ -63,36 +63,6 @@ func run(done chan<- string, job worker.WorkflowJob) (func() error, error) {
|
||||
}
|
||||
defer client.Disconnect()
|
||||
|
||||
// TODO check for the database status
|
||||
|
||||
events, err := client.Event.FindMany(
|
||||
db.Event.TenantID.Equals(c.TenantId()),
|
||||
db.Event.Key.Equals("user:create:timeout"),
|
||||
).With(
|
||||
db.Event.WorkflowRuns.Fetch().With(
|
||||
db.WorkflowRunTriggeredBy.Parent.Fetch().With(
|
||||
db.WorkflowRun.JobRuns.Fetch().With(
|
||||
db.JobRun.StepRuns.Fetch(),
|
||||
),
|
||||
),
|
||||
),
|
||||
).Exec(context.Background())
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("error finding events: %w", err))
|
||||
}
|
||||
|
||||
for _, event := range events {
|
||||
for _, workflowRun := range event.WorkflowRuns() {
|
||||
for _, jobRuns := range workflowRun.Parent().JobRuns() {
|
||||
for _, stepRun := range jobRuns.StepRuns() {
|
||||
if stepRun.Status != db.StepRunStatusFailed {
|
||||
panic(fmt.Errorf("expected step run to be failed, got %s", stepRun.Status))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
done <- "done"
|
||||
}()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user