remove cron.py file
cerley beat worker redis setting for cerley
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
from .celery import app as celery_app
|
||||
|
||||
__all__ = ('celery_app',)
|
||||
@@ -0,0 +1,8 @@
|
||||
import os
|
||||
from celery import Celery
|
||||
from django.conf import settings
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'core.settings.production')
|
||||
app = Celery('core')
|
||||
app.config_from_object('django.conf:settings', namespace='CELERY')
|
||||
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
|
||||
@@ -65,7 +65,7 @@ INSTALLED_APPS = [
|
||||
"rest_framework.authtoken",
|
||||
"import_export",
|
||||
"django_jalali",
|
||||
'django_crontab',
|
||||
'django_celery_beat',
|
||||
# Custom Apps
|
||||
"product",
|
||||
"account",
|
||||
@@ -234,12 +234,3 @@ AWS_S3_OBJECT_PARAMETERS = {
|
||||
'ACL': 'public-read',
|
||||
}
|
||||
|
||||
# ==============================================================================
|
||||
# django CRONJOBS
|
||||
# ==============================================================================
|
||||
|
||||
CRONJOBS = [
|
||||
('* * * * *', 'product.cron.update_product_prices', f'>> {BASE_DIR}/logfile.log 2>&1'),
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -46,4 +46,23 @@ MEDIA_URL = 'https://c262408.parspack.net/'
|
||||
MEDIA_ROOT = '/app/media'
|
||||
|
||||
STATIC_URL = '/shop_static/'
|
||||
STATIC_ROOT = '/app/static'
|
||||
STATIC_ROOT = '/app/static'
|
||||
|
||||
|
||||
# ==============================================================================
|
||||
# django cerery
|
||||
# ==============================================================================
|
||||
|
||||
CELERY_BROKER_URL = "redis://redis:6379/0"
|
||||
CELERY_RESULT_BACKEND = "redis://redis:6379/0"
|
||||
CELERY_TIMEZONE = "UTC"
|
||||
CELERY_BEAT_SCHEDULER = 'django_celery_beat.schedulers:DatabaseScheduler'
|
||||
|
||||
from celery.schedules import crontab
|
||||
|
||||
CELERY_BEAT_SCHEDULE = {
|
||||
'update-prices-every-minute': {
|
||||
'task': 'product.tasks.update_product_prices',
|
||||
'schedule': crontab(minute='*'),
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user