Commit 92591565 by J. Cliff Dyer

review response.

parent 9d545eca
...@@ -2,14 +2,16 @@ ...@@ -2,14 +2,16 @@
Asynchronous tasks related to the Course Blocks sub-application. Asynchronous tasks related to the Course Blocks sub-application.
""" """
import logging import logging
from capa.responsetypes import LoncapaProblemError from capa.responsetypes import LoncapaProblemError
from celery.task import task from celery.task import task
from django.conf import settings from django.conf import settings
from edxval.api import ValInternalError
from lxml.etree import XMLSyntaxError from lxml.etree import XMLSyntaxError
from edxval.api import ValInternalError
from opaque_keys.edx.keys import CourseKey from opaque_keys.edx.keys import CourseKey
from xmodule.modulestore.exceptions import ItemNotFoundError
from xmodule.modulestore.exceptions import ItemNotFoundError
from openedx.core.djangoapps.content.block_structure import api from openedx.core.djangoapps.content.block_structure import api
log = logging.getLogger('edx.celery.task') log = logging.getLogger('edx.celery.task')
...@@ -31,14 +33,13 @@ def update_course_in_cache(course_id): ...@@ -31,14 +33,13 @@ def update_course_in_cache(course_id):
course_key = CourseKey.from_string(course_id) course_key = CourseKey.from_string(course_id)
api.update_course_in_cache(course_key) api.update_course_in_cache(course_key)
except NO_RETRY_TASKS as exc: except NO_RETRY_TASKS as exc:
log.info("update_course_in_cache encountered unrecoverable error: {}".format(exc)) # Known unrecoverable errors
raise raise
except RETRY_TASKS as exc: except RETRY_TASKS as exc:
log.info("update_course_in_cache encounted expected error, retrying.") log.exception("update_course_in_cache encounted expected error, retrying.")
raise update_course_in_cache.retry(args=[course_id], exc=exc) raise update_course_in_cache.retry(args=[course_id], exc=exc)
except Exception as exc: # pylint: disable=broad-except except Exception as exc: # pylint: disable=broad-except
log.info("update_course_in_cache encounted unknown error. Retry #{}, Exception: {}".format( log.exception("update_course_in_cache encounted unknown error. Retry #{}".format(
update_course_in_cache.request.retries, update_course_in_cache.request.retries,
repr(exc)
)) ))
raise update_course_in_cache.retry(args=[course_id], exc=exc) raise update_course_in_cache.retry(args=[course_id], exc=exc)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment