Skip to content

Set options['expire_seconds'] from model.expire_seconds #564

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

bbkgh
Copy link

@bbkgh bbkgh commented Jul 11, 2022

No description provided.

Copy link
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whats problem will this change solve? can you add test to verify this?

@auvipy
Copy link
Member

auvipy commented Oct 13, 2022

@954-Ivory can you verify this patch?

@954-Ivory
Copy link
Contributor

954-Ivory commented Oct 13, 2022

Do not approved this PR.

def expires_(self):
return self.expires or self.expire_seconds

def _clean_expires(self):
if self.expire_seconds is not None and self.expires:
raise ValidationError(
_('Only one can be set, in expires and expire_seconds')
)

expires or expire_seconds only one can be set.

@954-Ivory
Copy link
Contributor

I went to test just now, expire_seconds seems doesn't work in master branch.

Copy link
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need regression test to verify this

@auvipy auvipy requested a review from Copilot May 18, 2025 03:50
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for reading an expire_seconds attribute from the schedule model and including it in the task options sent to the broker.

  • Adds a conditional to map model.expire_seconds into self.options
  • Preserves existing handling of the older expires_ attribute
Comments suppressed due to low confidence (1)

django_celery_beat/schedulers.py:80

  • Celery recognizes an expires option (accepting an int for seconds) rather than expire_seconds. Consider using self.options['expires'] = model.expire_seconds or verify that your broker supports the expire_seconds key.
self.options['expire_seconds'] = model.expire_seconds

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

codecov bot commented May 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@119357a). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #564   +/-   ##
=======================================
  Coverage        ?   88.21%           
=======================================
  Files           ?       32           
  Lines           ?     1010           
  Branches        ?      106           
=======================================
  Hits            ?      891           
  Misses          ?      101           
  Partials        ?       18           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

3 participants