Commit 2f3b0b4c by Nimisha Asthagiri

Storage-backed versioned Block Structures: Settings

parent fb73888e
......@@ -597,6 +597,9 @@ BROKER_URL = "{0}://{1}:{2}@{3}/{4}".format(CELERY_BROKER_TRANSPORT,
CELERY_BROKER_VHOST)
BROKER_USE_SSL = ENV_TOKENS.get('CELERY_BROKER_USE_SSL', False)
# Block Structures
BLOCK_STRUCTURES_SETTINGS = ENV_TOKENS.get('BLOCK_STRUCTURES_SETTINGS', BLOCK_STRUCTURES_SETTINGS)
# upload limits
STUDENT_FILEUPLOAD_MAX_SIZE = ENV_TOKENS.get("STUDENT_FILEUPLOAD_MAX_SIZE", STUDENT_FILEUPLOAD_MAX_SIZE)
......
......@@ -80,11 +80,11 @@ BLOCK_STRUCTURES_SETTINGS = dict(
# We have CELERY_ALWAYS_EAGER set to True, so there's no asynchronous
# code running and the celery routing is unimportant.
# It does not make sense to retry.
BLOCK_STRUCTURES_TASK_MAX_RETRIES=0,
TASK_MAX_RETRIES=0,
# course publish task delay is irrelevant is because the task is run synchronously
BLOCK_STRUCTURES_COURSE_PUBLISH_TASK_DELAY=0,
COURSE_PUBLISH_TASK_DELAY=0,
# retry delay is irrelevent because we never retry
BLOCK_STRUCTURES_TASK_DEFAULT_RETRY_DELAY=0,
TASK_DEFAULT_RETRY_DELAY=0,
)
###################### Grade Downloads ######################
......
......@@ -1805,13 +1805,18 @@ BLOCK_STRUCTURES_SETTINGS = dict(
# for a better chance at getting the latest changes when there
# are secondary reads in sharded mongoDB clusters. See TNL-5041
# for more info.
BLOCK_STRUCTURES_COURSE_PUBLISH_TASK_DELAY=30,
COURSE_PUBLISH_TASK_DELAY=30,
# Delay, in seconds, between retry attempts if a task fails.
BLOCK_STRUCTURES_TASK_DEFAULT_RETRY_DELAY=30,
TASK_DEFAULT_RETRY_DELAY=30,
# Maximum number of retries per task.
BLOCK_STRUCTURES_TASK_MAX_RETRIES=5,
TASK_MAX_RETRIES=5,
# Backend storage
# STORAGE_CLASS='storages.backends.s3boto.S3BotoStorage',
# STORAGE_KWARGS=dict(bucket='nim-beryl-test'),
# DIRECTORY_PREFIX='/modeltest/',
)
################################ Bulk Email ###################################
......
......@@ -28,7 +28,7 @@ def _listen_for_course_publish(sender, course_key, **kwargs): # pylint: disable
update_course_in_cache.apply_async(
[unicode(course_key)],
countdown=settings.BLOCK_STRUCTURES_SETTINGS['BLOCK_STRUCTURES_COURSE_PUBLISH_TASK_DELAY'],
countdown=settings.BLOCK_STRUCTURES_SETTINGS['COURSE_PUBLISH_TASK_DELAY'],
)
......
......@@ -22,8 +22,8 @@ NO_RETRY_TASKS = (XMLSyntaxError, LoncapaProblemError, UnicodeEncodeError)
@task(
default_retry_delay=settings.BLOCK_STRUCTURES_SETTINGS['BLOCK_STRUCTURES_TASK_DEFAULT_RETRY_DELAY'],
max_retries=settings.BLOCK_STRUCTURES_SETTINGS['BLOCK_STRUCTURES_TASK_MAX_RETRIES'],
default_retry_delay=settings.BLOCK_STRUCTURES_SETTINGS['TASK_DEFAULT_RETRY_DELAY'],
max_retries=settings.BLOCK_STRUCTURES_SETTINGS['TASK_MAX_RETRIES'],
bind=True,
)
def update_course_in_cache(self, course_id):
......@@ -34,8 +34,8 @@ def update_course_in_cache(self, course_id):
@task(
default_retry_delay=settings.BLOCK_STRUCTURES_SETTINGS['BLOCK_STRUCTURES_TASK_DEFAULT_RETRY_DELAY'],
max_retries=settings.BLOCK_STRUCTURES_SETTINGS['BLOCK_STRUCTURES_TASK_MAX_RETRIES'],
default_retry_delay=settings.BLOCK_STRUCTURES_SETTINGS['TASK_DEFAULT_RETRY_DELAY'],
max_retries=settings.BLOCK_STRUCTURES_SETTINGS['TASK_MAX_RETRIES'],
bind=True,
)
def get_course_in_cache(self, course_id):
......
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