Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[BUG + REFACTOR] Change behavior ofJobQueue.run_monthly #2627

Closed
Assignees
iota-008
Labels
Milestone
@Bibo-Joshi

Description

@Bibo-Joshi

Steps to reproduce

  1. job_queue.run_monthly(day=30, day_is_strict=False)

Expected behaviour

Runs on 30th day of each month excluding Feb + on Feb 28th/29th

Actual behaviour

Runs on 30thand 31st day of each month excluding Feb + on Feb 28th/29th

This happens because I didn't pay enough attention when writing this:

else:
trigger=OrTrigger(
[
CronTrigger(
day=day,
hour=when.hour,
minute=when.minute,
second=when.second,
timezone=when.tzinfo,
**job_kwargs,
),
CronTrigger(
day='last',
hour=when.hour,
minute=when.minute,
second=when.second,
timezone=when.tzinfoorself.scheduler.timezone,
**job_kwargs,
),
]
)

However, the use case ofday_is_strict is mainly "run on the last day of the month". I therefore suggest to just drop the parameter and instead allow to passday='last' orday=-1 (I like this one better) to indicate that you want to run the job on the last day of the month.
The use case described above can still be achieved withrun_custom.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp