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

Add: advanced cron-like scheduling for queries #1434

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@luke14free
Contributor

luke14free commented Nov 28, 2016

Same as #1425 but on master, closing the old PR.
50ee033a-b16c-11e6-98d9-50b5e2d0e5e8

@luke14free

This comment has been minimized.

Show comment
Hide comment
@luke14free

luke14free Dec 13, 2016

Contributor

can I do anything to facilitate the review/merge of this PR? :)

Contributor

luke14free commented Dec 13, 2016

can I do anything to facilitate the review/merge of this PR? :)

@arikfr arikfr changed the title from Adding advanced cron-like scheduling for queries to Add: advanced cron-like scheduling for queries Dec 13, 2016

@arikfr

Can you add screenshots of how the preview text looks like?

I think I commented this in a previous iteration of this pull request -- how about we remove support for a cron string? Do you see use cases that won't be covered by the weekly/monthly schedules?

migrator = PostgresqlMigrator(db.database)
with db.database.transaction():
db.database.execute_sql('ALTER TABLE queries ALTER COLUMN schedule TYPE text;')
db.close_db(None)

This comment has been minimized.

@arikfr

arikfr Dec 13, 2016

Member

You need to rebase and use the new Alembic migrations.

@arikfr

arikfr Dec 13, 2016

Member

You need to rebase and use the new Alembic migrations.

@@ -685,6 +688,9 @@ def should_schedule_next(previous_iteration, now, schedule):
previous_iteration = normalized_previous_iteration - datetime.timedelta(days=1)
next_iteration = (previous_iteration + datetime.timedelta(days=1)).replace(hour=hour, minute=minute)
else:
future_dates = croniter(schedule, previous_iteration)
next_iteration = future_dates.get_next(datetime.datetime)

This comment has been minimized.

@arikfr

arikfr Dec 13, 2016

Member

This is too critical to go without tests.

@arikfr

arikfr Dec 13, 2016

Member

This is too critical to go without tests.

@arikfr

This comment has been minimized.

Show comment
Hide comment
@arikfr

arikfr Sep 13, 2017

Member

Please reopen when updated. Thanks!

Member

arikfr commented Sep 13, 2017

Please reopen when updated. Thanks!

@arikfr arikfr closed this Sep 13, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment