remove cron.py file

cerley beat worker redis
setting for cerley
This commit is contained in:
Parsa Nazer
2025-03-10 16:40:12 +03:30
parent 0f29b34a6e
commit d6df8d9b8c
10 changed files with 154 additions and 28 deletions
+1 -10
View File
@@ -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'),
]
+20 -1
View File
@@ -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='*'),
},
}