Permalink
Browse files

Adding some configurable settings for the retry magic

  • Loading branch information...
1 parent e1a5b46 commit 52f9c127934227243a35224247189b9416222a47 @codekoala committed Dec 27, 2010
Showing with 6 additions and 2 deletions.
  1. +6 −2 queued_storage/tasks.py
View
@@ -1,12 +1,16 @@
+from django.conf import settings
from django.core.cache import cache
from django.core.files.storage import get_storage_class
from celery.registry import tasks
from celery.task import Task
+MAX_RETRIES = getattr(settings, 'QUEUED_REMOTE_STORAGE_RETRIES', 5)
+RETRY_DELAY = getattr(settings, 'QUEUED_REMOTE_STORAGE_RETRY_DELAY', 60)
+
class SaveToRemoteTask(Task):
- max_retries = 5
- default_retry_delay = 60
+ max_retries = MAX_RETRIES
+ default_retry_delay = RETRY_DELAY
def run(self, name, local, remote, cache_key, **kwargs):
local_storage = get_storage_class(local)()

0 comments on commit 52f9c12

Please sign in to comment.