-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is the first step in removing celery usage. This removes all the tasks and folds the important bits into the code that kicks off those tasks. * for tecken.download, if there's a problem saving the missing symbol to the db, we let it go instead of spinning that off into a task * for tecken.upload, we fold the uploads_created bookkeeping into the upload task; prod dashboard shows this takes a few seconds at most and usually it's under half a second * don't need a sample_task or the infrastructure to test that celery is working anymore * for tecken.upload, we nix invalidating the symbolicate cache--this code isn't long for this world and socorro doesn't invalidate its cache on uploads, to I think it's ok to degrade the service here
- Loading branch information
Showing
27 changed files
with
51 additions
and
561 deletions.
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
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 was deleted.
Oops, something went wrong.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -31,7 +31,6 @@ used by Mozilla. | |
contributing | ||
dev | ||
configuration | ||
celery | ||
frontend | ||
redis | ||
adr_log | ||
|
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -81,15 +81,6 @@ def test_something(requestsmock): | |
yield m | ||
|
||
|
||
@pytest.fixture | ||
def celery_config(): | ||
return { | ||
"broker_url": "redis://redis-cache:6379/0", | ||
"result_backend": "redis://redis-cache:6379/0", | ||
"task_always_eager": True, | ||
} | ||
|
||
|
||
# This needs to be imported at least once. Otherwise the mocking | ||
# done in botomock() doesn't work. | ||
# (peterbe) Would like to know why but for now let's just comply. | ||
|
@@ -170,42 +161,6 @@ def fakeuser(): | |
return User.objects.create(username="peterbe", email="[email protected]") | ||
|
||
|
||
def _mock_invalidate_symbolicate_cache(function_path): | ||
class FakeTask: | ||
all_delay_arguments = [] | ||
|
||
def delay(self, *args, **kwargs): | ||
self.all_delay_arguments.append((args, kwargs)) | ||
|
||
fake_task = FakeTask() | ||
|
||
with mock.patch(function_path, new=fake_task): | ||
yield fake_task | ||
|
||
|
||
@pytest.fixture | ||
def upload_mock_invalidate_symbolicate_cache(): | ||
"""Yields an object that is the mocking substitute of some task | ||
functions that are imported by the views. | ||
If a view function (that you know your test will execute) depends | ||
on 'tecken.symbolicate.tasks.invalidate_symbolicate_cache', add | ||
this fixture to your test. Then you can access all the arguments | ||
sent to it as `.delay()` arguments and keyword arguments. | ||
""" | ||
|
||
class FakeTask: | ||
all_delay_arguments = [] | ||
|
||
def delay(self, *args, **kwargs): | ||
self.all_delay_arguments.append((args, kwargs)) | ||
|
||
fake_task = FakeTask() | ||
|
||
_mock_function = "tecken.upload.views.invalidate_symbolicate_cache_task" | ||
with mock.patch(_mock_function, new=fake_task): | ||
yield fake_task | ||
|
||
|
||
@pytest.fixture | ||
def upload_mock_update_uploads_created_task(): | ||
"""Yields an object that is the mocking substitute of some task | ||
|
Oops, something went wrong.