If entry ID is not set, delete entry for failed entries

This commit is contained in:
Mustafa Gezen 2023-09-06 23:29:43 +02:00
parent a7332a640b
commit 847abe2258
Signed by: mustafa
GPG Key ID: DCDF010D946438C1

View File

@ -179,6 +179,12 @@ func ProcessRPMWorkflow(ctx workflow.Context, args *mothershippb.ProcessRPMArgs)
MaximumAttempts: 0,
},
})
// Check if entry has EntryID set, if not then we can just delete the entry
if entry.EntryId == "" {
_ = workflow.ExecuteActivity(ctx, w.DeleteEntry, entry.Name).Get(ctx, nil)
return
}
_ = workflow.ExecuteActivity(ctx, w.SetEntryState, entry.Name, mothershippb.Entry_FAILED, nil).Get(ctx, nil)
}()