Skip to content

Commit

Permalink
Merge pull request #938 from readthedocs/davidfischer/fix-task-import
Browse files Browse the repository at this point in the history
Fix a celerybeat task configuration
  • Loading branch information
davidfischer authored Nov 4, 2024
2 parents c84adf3 + 76ebdf7 commit 795a0bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@

import ethicalads_ext # noqa

ext = True
ADSERVER_EXT = True
except ImportError:
ext = False
ADSERVER_EXT = False

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
Expand Down Expand Up @@ -533,9 +533,9 @@
)
if ADSERVER_ANALYZER_BACKEND:
INSTALLED_APPS.append("adserver.analyzer")
if ADSERVER_ANALYZER_BACKEND and ext:
if ADSERVER_ANALYZER_BACKEND and ADSERVER_EXT:
INSTALLED_APPS.append("ethicalads_ext.embedding")
if ext:
if ADSERVER_EXT:
INSTALLED_APPS.append("ethicalads_ext.support")

# Whether Do Not Track is enabled for the ad server
Expand Down
3 changes: 2 additions & 1 deletion config/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,9 @@
"task": "adserver.analyzer.tasks.daily_analyze_urls",
"schedule": crontab(hour="4", minute="0"),
}
if "ethicalads_ext.embedding" in INSTALLED_APPS:
CELERY_BEAT_SCHEDULE["every-day-analyze-advertiser-urls"] = {
"task": "adserver.analyzer.tasks.daily_analyze_advertiser_urls",
"task": "ethicalads_ext.embedding.tasks.daily_analyze_advertiser_urls",
"schedule": crontab(hour="4", minute="30"),
}

Expand Down

0 comments on commit 795a0bf

Please sign in to comment.