taubyte / tau

Open source distributed Platform as a Service (PaaS). A self-hosted Vercel / Netlify / Cloudflare alternative.
https://tau.how
BSD 3-Clause "New" or "Revised" License
3.39k stars 95 forks source link

Handle context done when ci/cd job has a delay #151

Closed samyfodil closed 5 months ago

samyfodil commented 6 months ago

In https://github.com/taubyte/tau/blob/main/protocols/monkey/jobs/run.go#L20, the go routine will wait but will not break if the context ends. It's already channels, all that needs to be done is wrap this up with a select and add a case for ctx.Done().

mortum5 commented 5 months ago

What error should be returned in case of ctx.Done()?

samyfodil commented 5 months ago

Yes I would return an error.