27 Commits

Author SHA1 Message Date
Kyle McCormick
25df9ca420 refactor: make safe_lxml an ordinary folder in openedx/core/lib (#25689) 2022-05-24 15:35:23 +05:00
SaadYousaf
bb80192f1c fix: update lxml parser for celery tasks to be more secure 2021-08-05 10:56:28 -04:00
Kyle McCormick
9aefd6f986 style: django-not-configured is not a sensible lint-amnesty value (#26862)
django-not-configured is an error raised by pylint (with
the pylint-django plugin) when it's not correctly configured.

We should not be applying lint amnesty for such a violation.
2021-03-05 08:11:58 -05:00
usamasadiq
8556d670a2 Applied pylint-amnesty 2021-02-02 15:29:41 +05:00
Muhammad Soban Javed
bd601cf3a6 Update celery routing for celery 4+ (#25567)
* Update celery routing

- Used routing function instead of class
- Move task queues dictionary to Django settings
- Removed routing_key parameter
- Refactored routing for singleton celery instantiation

Co-authored-by: Awais Qureshi <awais.qureshi@arbisoft.com>
2020-12-16 13:40:47 +05:00
Tim McCormack
0c57a02119 Enforce a Celery singleton across cms and lms by using shared module (#25840)
This should prevent the issues we've seen recently where cms modules are
imported by the running lms process, resulting in two celery instances
being created and tasks intermittently being registered to the wrong
instance (and therefore effectively lost.)

In commit ab6bf348d4/PR #25822 we tried to ensure that only one or the
other of the instances was created by adding a startup check.
Unfortunately, there's an external shared library that refers directly
to the lms celery, causing a startup failure in cms, so we had to revert
it. Rather than waiting to fix that library, this commit collapses
the two instances together so that there is only ever one.
2020-12-10 17:54:31 +00:00
Awais Qureshi
7201edb11d Revert "Update routing config" (#25536)" (#25549)" (#25553)" (#25561)
This reverts commit db4c3b1210.
2020-11-11 00:13:47 +05:00
Awais Qureshi
db4c3b1210 Revert "Revert ""Update routing config" (#25536)" (#25549)" (#25553)
This reverts commit c1fe3c3a93.
2020-11-10 23:23:09 +05:00
Muhammad Soban Javed
c1fe3c3a93 Revert ""Update routing config" (#25536)" (#25549)
This reverts commit 39a22734c1.
2020-11-09 23:43:47 +05:00
Awais Qureshi
39a22734c1 "Update routing config" (#25536)
* Revert "Revert "Update routing config"

* Removed settings from lms/celery.py and cms/celery.py

* Moved settings import from top-level to function's scopes

Co-authored-by: Soban Javed <iamsobanjaved@gmail.com>
2020-11-09 19:06:55 +05:00
Muhammad Soban Javed
5a2ea1f954 Revert "Update routing config" 2020-11-06 02:05:48 +05:00
Soban Javed
3206d9cb9a Update celery routing
- Used routing function istead of class
- Move task queues to Djano settings
- Removed routing_key parameter
2020-11-02 15:03:53 +05:00
Feanil Patel
8cd544b8ec Put settings import back because it's used here. (#25481)
But change the order so that celery is loaded first.
2020-10-29 13:48:53 -04:00
Feanil Patel
2175d00b83 Update celery task discovery config. (#25479)
Update the celery startup code to more closely match the docs.  We believe some of these imports are causeing circulare
dependencies that are causing race conditions in task discovery.  Since all django apps should be loaded using the
django fixup in celery 4, we shouldn't need these other overrides.

https://github.com/celery/celery/blob/v4.4.7/celery/fixups/django.py
https://docs.celeryproject.org/en/v4.4.7/django/first-steps-with-django.html#using-celery-with-django
2020-10-29 10:52:16 -04:00
Feanil Patel
375173f1df Use the default autodiscovery instead of passing in the installed apps. (#25467)
Passing in the INSTALLED_APPS lambda seems to result in some tasks for certain apps
like instructor_task and bulk_email to not get discovered properly.
2020-10-28 15:13:24 -04:00
Soban Javed
b7ca6d5619 Upgrade celery to 4.4.7
Replace django-celery with django-celery-results
Upgrade redis to latest
2020-09-22 16:20:45 +05:00
Feanil Patel
9cf2f9f298 Run 2to3 -f future . -w
This will remove imports from __future__ that are no longer needed.

https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
2019-12-30 10:35:30 -05:00
Jeremy Bowman
713d64e1e2 TE-2702 Update Read the Docs links to HTTPS 2018-08-15 17:34:01 -04:00
J. Cliff Dyer
f3be0ad775 Send all update_aggregators task to LMS. 2018-03-22 10:41:43 -04:00
Alex Dusenbery
6dfa47b2fc EDUCATOR-565 | Add POLICY_CHANGE_GRADES_ROUTING_KEY, fix errors in compute_all_grades_for_course circuitry. 2017-07-11 14:01:38 -04:00
Gregory Martin
77b2229210 GradingPolicyChanged Signal Handler
https://openedx.atlassian.net/browse/EDUCATOR-393
2017-05-31 10:46:55 -04:00
Andy Armstrong
ebb04ca396 Reorder Studio imports using isort 2017-05-30 17:00:50 -04:00
Gregory Martin
70905c8aab compute grades task register
https://openedx.atlassian.net/browse/EDUCATOR-388
2017-05-12 16:25:14 -04:00
Nimisha Asthagiri
e83182c743 Have generate_course_blocks pass with_storage option to celery tasks 2017-03-20 16:22:44 -04:00
Eric Fischer
fdc6d91588 update_in_cache on lms worker (#12689)
This commit "undoes"a previous hotfix, and allows a cms course_publish
signal to trigger a block_structure update_course_in_cache task, which
is run on an lms worker queue.

Changes:
    -exposes ALTERNATE_QUEUE_ENVS
    -adds routing layer in celery.py
    -moves prior dev_with_worker settings file to devstack_with_worker
    -moves course_block api functionality into openedx/core/djangoapps/content/block_structure
2016-06-16 18:01:06 -04:00
Feanil Patel
6289b190d9 Fix pep8 and pylint. 2015-05-08 09:01:50 -04:00
Feanil Patel
27223ae80f Load celery for CMS as well. 2015-05-08 09:01:48 -04:00