Skip to content

Commit

Permalink
Celery Settings Fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
DEKHTIARJonathan committed Aug 21, 2017
1 parent b0b83a9 commit 5bcdac6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
7 changes: 7 additions & 0 deletions application/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
from celery import Celery
from celery.schedules import crontab

from datetime import timedelta

import django

platforms = ["TRAVIS", "HEROKU", "BLUEMIX"]
Expand Down Expand Up @@ -69,6 +71,11 @@ def load_env():
app.conf.beat_sync_every = settings.CELERYBEAT_SYNC_EVERY
app.conf.beat_max_loop_interval = settings.CELERYBEAT_MAX_LOOP_INTERVAL

# Celery Monitor Settings
app.conf.monitors_expire_success = timedelta(hours=1)
app.conf.monitors_expire_error = timedelta(days=3)
app.conf.monitors_expire_pending = timedelta(days=5)

class CeleryConfig(AppConfig):
name = 'application'
verbose_name = 'Celery Config'
Expand Down
8 changes: 2 additions & 6 deletions application/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,16 +329,12 @@ def assign_env_value(var_name):
'task': 'feedcrunch.tasks.refresh_all_rss_subscribers_count',
'schedule': crontab(hour=0, minute=5), # Everyday at midnight + 5mins
#'schedule': crontab(minute='*/1'),
'options': {
'expires': 20*60, # 20 minutes
}
# 'options': { 'expires': 20*60 } # 20 minutes
},
'refresh_all_rss_feeds': {
'task': 'feedcrunch.tasks.refresh_all_rss_feeds',
'schedule': crontab(minute='30'), # Every hours when minutes = 30mins
#'schedule': crontab(minute='*/1'),
'options': {
'expires': 20*60, # 20 minutes
}
# 'options': { 'expires': 20*60 } # 20 minutes
},
}

0 comments on commit 5bcdac6

Please sign in to comment.