You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am assuming that if event already fired in the past, then step.waitForEvent() resolves immediately.
or do I need to do something like this?
constsummarized=awaitstep.run('get-last-suggest-article-sources-id',async()=>{returnawaitpool.oneFirst(sql.type(z.object({ended: z.boolean(),}),)` SELECT ended_at IS NOT NULL AS ended FROM suggest_article_sources WHERE article_project_id = ${articleProject.id} ORDER BY created_at DESC LIMIT 1 `);},);if(!summarized){awaitstep.waitForEvent('wait-for-suggest-article-sources',{event: 'aimd/article-sources.summarized',if: `async.data.articleProjectId = ${articleProject.id}`,timeout: '5 minutes',});}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
It is not clear from reading the documentation, if I need to worry about the cases where the event fires before I start waiting for the event.
https://www.inngest.com/docs/reference/functions/step-wait-for-event
I am assuming that if event already fired in the past, then
step.waitForEvent()
resolves immediately.or do I need to do something like this?
Beta Was this translation helpful? Give feedback.
All reactions