-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Celery task to clear schedule was added #3801
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
c3c1812
Celery task to clear schedule was added
aidarbek 0cbffd5
fix formating
aidarbek e288e12
empty_schedules task was put in separate task
aidarbek 50ac0ab
worker interval changed, new tests added
aidarbek 4d1a7c4
past artifact deleted
aidarbek 82f3e17
test queries moved to right class, lambda was used to filter data
aidarbek 3232b1c
unnecessary changes eliminated
aidarbek 45d2448
more unnecessary files deleted
aidarbek 59258ea
line shortened
aidarbek c4479e7
Line shortened more
aidarbek 397016d
codeclimate changes
aidarbek 0426d51
Unused test deleted, logs added
aidarbek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from .general import record_event, version_check, send_mail, sync_user_details | ||
from .queries import QueryTask, refresh_queries, refresh_schemas, cleanup_query_results, execute_query | ||
from .queries import QueryTask, refresh_queries, refresh_schemas, cleanup_query_results, execute_query, empty_schedules | ||
from .alerts import check_alerts_for_query |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import datetime | ||
from mock import patch | ||
from tests import BaseTestCase | ||
from redash.tasks import empty_schedules | ||
from redash.models import Query | ||
from redash.utils import utcnow | ||
|
||
|
||
class TestEmptyScheduleQuery(BaseTestCase): | ||
def test_empty_schedules(self): | ||
one_day_ago = (utcnow() - datetime.timedelta(days=1)).strftime("%Y-%m-%d") | ||
query = self.factory.create_query(schedule={'interval':'3600','until':one_day_ago}) | ||
oq = staticmethod(lambda: [query]) | ||
with patch.object(Query, 'past_scheduled_queries', oq): | ||
empty_schedules() | ||
self.assertEqual(query.schedule, None) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a log message here, just so admins will be able to traceback changes.