Skip to content

Conversation

@zevaryx
Copy link
Member

@zevaryx zevaryx commented Mar 17, 2024

Pull Request Type

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

Description

Adds a new Task Trigger, CronTrigger. Pass a cron string to it (i.e. 0 0 * * *), and it'll run tasks based on that cron string

Changes

  • Add croniter requirement
  • Add CronTrigger task trigger

Related Issues

Test Scenarios

@Task.create(CronTrigger("* * * * *"))
async def test_cron(self) -> None:
    print("I run every minute!")

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

@zevaryx zevaryx changed the base branch from stable to unstable March 17, 2024 05:01
@AstreaTSS
Copy link
Member

This debatably solves #1560.

@silasary
Copy link
Member

This debatably solves #1560.

I think it does, yeah

@eightween eightween changed the title [feat] Add CronTrigger feat: add new CronTrigger task type Mar 30, 2024
@eightween eightween added enhancement New feature or request pending Pending approve priority This Issue/PR must be resolved first before accepting any others labels Mar 30, 2024
@eightween eightween requested a review from AstreaTSS March 30, 2024 20:59
zevaryx and others added 5 commits March 30, 2024 17:05
I'm aware that datetime is not what it actually is, but we shouldn't be using private data types in our docstrings. Developers will additionally be using it as a reference, not the literal representation when using

Signed-off-by: 18 <[email protected]>
@eightween eightween enabled auto-merge (squash) March 30, 2024 21:07
Copy link
Member

@AstreaTSS AstreaTSS left a comment

Choose a reason for hiding this comment

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

Don't know what's going on with the PR's diff, but looks fine otherwise.

@eightween eightween merged commit a6ec7f3 into interactions-py:unstable Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request pending Pending approve priority This Issue/PR must be resolved first before accepting any others

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants