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

Task loop supports localized datetime from trigger #1656

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

ZeGmX
Copy link
Contributor

@ZeGmX ZeGmX commented Apr 7, 2024

Pull Request Type

  • Feature addition
  • Bugfix
  • Documentation update
  • Code refactor
  • Tests improvement
  • CI/CD pipeline enhancement
  • Other: [Replace with a description]

Description

Updated the _task_loop method from Task to allow the computation of timeout| on localized datetime objects.
The timeout computation would fail if self.trigger.next_fire() returned a localized object.

Changes

  • Updated line 100 of models.internal.tasks.task

Related Issues

Test Scenarios

  1. Create a class inheriting from BaseTrigger.
  2. Overload the next_fire() method to return a localized datetime object.
  3. Use this new Trigger to create a new Task
    This would fail prior to this commit, but now works.

Python Compatibility

  • I've ensured my code works on Python 3.10.x
  • I've ensured my code works on Python 3.11.x

Checklist

  • I've run the pre-commit code linter over all edited files
  • I've tested my changes on supported Python versions
  • I've added tests for my code, if applicable
  • I've updated / added documentation, where applicable

@silasary silasary merged commit b1b1554 into interactions-py:unstable Apr 24, 2024
2 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.

3 participants