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

[MSN-1990] Use env var to limit eta task #50

Merged

Conversation

iasmini
Copy link

@iasmini iasmini commented May 23, 2024

Context

In our current implementation of the later method, we do not have a mechanism to enforce a maximum allowable delay time for task scheduling. This can lead to tasks being scheduled far into the future, which might not be desirable or could cause unexpected behavior in our application. To address this, we need to introduce a check that ensures the delay time does not exceed a specified maximum value.

Issues

https://nilosaude.atlassian.net/browse/MSN-1989

Solution

This pull request introduces a new check within the later method to enforce a maximum allowable delay time for task scheduling. The maximum delay time is configurable through the MAXIMUM_ETA_TASK setting in Django. If the MAXIMUM_ETA_TASK setting is defined and the calculated delay exceeds this value, the method raises a ValueError indicating the delay time is invalid.
By adding this check, we ensure that the task scheduling respects the maximum delay time configured in our settings, thereby preventing tasks from being scheduled too far into the future.

@iasmini iasmini force-pushed the feature/msn-1990-ig-limit-eta-task branch 2 times, most recently from cf7463b to d55c196 Compare May 23, 2024 12:26
django_cloud_tasks/tasks/task.py Outdated Show resolved Hide resolved
@iasmini iasmini force-pushed the feature/msn-1990-ig-limit-eta-task branch from d55c196 to c328a46 Compare May 23, 2024 18:04
joaodaher
joaodaher previously approved these changes Jun 6, 2024
@iasmini iasmini force-pushed the feature/msn-1990-ig-limit-eta-task branch from e5917ed to 4eff848 Compare June 6, 2024 13:02
Copy link

codeclimate bot commented Jun 6, 2024

Code Climate has analyzed commit 4eff848 and detected 0 issues on this pull request.

View more on Code Climate.

@joaodaher joaodaher merged commit 80c689b into flamingo-run:main Jun 10, 2024
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants