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

allow '$' to indicate last day-of-month #20

Merged
merged 6 commits into from Jun 4, 2023
Merged

allow '$' to indicate last day-of-month #20

merged 6 commits into from Jun 4, 2023

Conversation

vixie
Copy link
Owner

@vixie vixie commented May 29, 2023

Co-authored-by: Junwang Zhao zhjwpku@gmail.com

Copy link
Collaborator

@millert millert left a comment

Choose a reason for hiding this comment

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

I noticed a few issues reading the diff, I haven't tried running it yet.

cron.c Outdated Show resolved Hide resolved
externs.h Show resolved Hide resolved
entry.c Outdated Show resolved Hide resolved
entry.c Show resolved Hide resolved
@vixie
Copy link
Owner Author

vixie commented May 30, 2023 via email

zhjwpku added a commit to zhjwpku/pg_cron that referenced this pull request May 31, 2023
Paul and me had a discussion about adding the feature of last day
of month, because there are things you must do on the last day of
the month, like:

- pay your rent, mortgage
- visit your mother or parole officer
- calculate paychecks for your empoyees

You may see the PR here:

vixie/cron#20

Signed-off-by: Junwang Zhao <zhjwpku@gmail.com>
zhjwpku added a commit to zhjwpku/pg_cron that referenced this pull request May 31, 2023
Paul and me had a discussion about adding the feature of last day
of month, because there are things you must do on the last day of
the month, like:

- pay your rent, mortgage
- visit your mother or parole officer
- calculate paychecks for your empoyees

You may see the PR here:

vixie/cron#20

Signed-off-by: Junwang Zhao <zhjwpku@gmail.com>
zhjwpku added a commit to zhjwpku/pg_cron that referenced this pull request May 31, 2023
Paul and I had a discussion about adding the feature of last day
of month, there are things you must do on the last day of the
month, like:

- pay your rent, mortgage
- visit your mother or parole officer
- calculate paychecks for your empoyees

So this is a resonable feature, see the PR here:

vixie/cron#20

Signed-off-by: Junwang Zhao <zhjwpku@gmail.com>
zhjwpku added a commit to zhjwpku/pg_cron that referenced this pull request May 31, 2023
Paul and I had a discussion about adding the feature of last day
of month, there are things you must do on the last day of the
month, like:

- pay your rent, mortgage
- visit your mother or parole officer
- calculate paychecks for your empoyees

So might be a reasonable feature, backport from this PR:

vixie/cron#20

Signed-off-by: Junwang Zhao <zhjwpku@gmail.com>
zhjwpku added a commit to zhjwpku/pg_cron that referenced this pull request May 31, 2023
Paul and I had a discussion about adding the feature of last day
of month, there are things you want do on the last day of the
month, like:

- pay your rent, mortgage
- visit your mother or parole officer
- calculate paychecks for your empoyees

So this might be a reasonable feature, backport from this PR:

vixie/cron#20

Signed-off-by: Junwang Zhao <zhjwpku@gmail.com>
paul vixie and others added 4 commits June 2, 2023 09:33
In load_entry, for @daily or @midnight, we should set every bit
for the dow bitstr_t, pull request 16 just set FIRST_DOW, which
wrong; for @hourly, the set_element of dow is redundant since
set_range set each bit of dow.

I believe these are typos when replacing bit_set/bit_nset using
set_element/set_range, I did't review it carefully, sorry for
the inconvenient.

Signed-off-by: Junwang Zhao <zhjwpku@gmail.com>
62a064f replaced the for loop of set_element with the newly added
set_range, so the variable i is no longer needed.

Signed-off-by: Junwang Zhao <zhjwpku@gmail.com>
@vixie vixie requested review from zhjwpku and millert June 2, 2023 09:50
Copy link
Contributor

@zhjwpku zhjwpku left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

Copy link
Collaborator

@millert millert left a comment

Choose a reason for hiding this comment

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

Looks good to me

@vixie vixie merged commit a79c527 into master Jun 4, 2023
@vixie vixie deleted the lastdom branch June 4, 2023 19:36
@vixie vixie restored the lastdom branch June 4, 2023 19:38
@vixie vixie deleted the lastdom branch June 4, 2023 19:41
@vixie vixie restored the lastdom branch June 4, 2023 20:57
zhjwpku added a commit to zhjwpku/pg_cron that referenced this pull request Jun 5, 2023
Paul and I had a discussion about adding the feature of last day
of month, there are things you want do on the last day of the
month, like:

- pay your rent, mortgage
- visit your mother or parole officer
- calculate paychecks for your empoyees

So this might be a reasonable feature, the idea using '$' to indicate
last day-of-month came from regex syntax, '$' is the end of a line.

backport from this PR:

vixie/cron#20

Signed-off-by: Junwang Zhao <zhjwpku@gmail.com>
@vixie vixie deleted the lastdom branch June 5, 2023 08:38
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.

None yet

3 participants