Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(webhooks): default task processor to use processor and prevent webhook retries in non-processor environments #3273

Merged
merged 2 commits into from
Jan 11, 2024

Conversation

matthewelwell
Copy link
Contributor

Changes

This PR does 2 things:

  1. Update the default value of the TASK_RUN_METHOD setting such that the task processor should always default to using the task processor itself, for any asynchronous invocations inside the tasks themselves.
  2. Prevent webhook retries when not using the task processor. This is done because we cannot handle backoff for e.g. separate thread or synchronous run methods.

How did you test this code?

In staging, we noticed that the changes made in this PR did not work as expected, since the tasks were run in a separate thread, not scheduled for the task processor. We will retest this behaviour in staging once this PR is merged.

Ran the processor locally and confirmed that the TASK_RUN_METHOD setting was correctly set to TASK_PROCESSOR when RUN_BY_PROCESSOR=True.

Ran the API locally and confirmed that the TASK_RUN_METHOD setting was correctly defaulted to SEPARATE_THREAD when RUN_BY_PROCESSOR=False

Added a unit test for testing new logic to prevent webhook retries.

Copy link

vercel bot commented Jan 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 11, 2024 0:01am
flagsmith-frontend-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 11, 2024 0:01am
flagsmith-frontend-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 11, 2024 0:01am

Copy link
Contributor

github-actions bot commented Jan 11, 2024

Uffizzi Preview deployment-44181 was deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants