denoland / deploy_feedback

For reporting issues with Deno Deploy
https://deno.com/deploy
74 stars 5 forks source link

[KV Feedback]: Kill queue listeners on preview deployments #567

Closed oliver-oloughlin closed 9 months ago

oliver-oloughlin commented 10 months ago

🔍

Type of feedback

Feature request

Description

The issue I am having is that when using queues on Deploy I only want my queue listeners to be active when on a production deployment. Much like how Deno.cron() works. The reason being is that there is some logic with my queue handlers that I definitely only want to run in production, and never simultaneously in other environments.

Steps to reproduce (if applicable)

No response

Expected behavior (if applicable)

No response

Possible solution (if applicable)

I wish there was some way to either specify for a project that queues should only be active in production, or to kill any active queue listeners on any given (or any non-production) deployment.

Additional context

No response

igorzi commented 10 months ago

Queue listeners should be no-op on preview deployments. @oliver-oloughlin do you have a project where this is not the case?

oliver-oloughlin commented 9 months ago

@igorzi I believe I have now discovered the cause of the issue, or really perceived issue. I saw logs in the preview build from queue handlers. It seems the logs were simply made from the latest, still running queue handlers. While later enqueues did not re-trigger the handlers.

So while a new production deployment was created, the jobs already running in the previous production build will continue until finished. Which makes sense.