Refactor project structure and update configurations for State Corp backend
- Updated project description in __init__.py - Enhanced .gitignore to exclude additional data files - Modified User model to remove first_name and last_name fields - Improved instance save method in services.py to include updated_at field - Added API tokens to .env.example for external services - Cleaned up test files for better readability - Updated Dockerfile and docker-compose.yml for improved setup - Revised README.md to reflect project changes and added changelog
This commit is contained in:
@@ -8,8 +8,13 @@ import os
|
||||
|
||||
from celery import Celery
|
||||
|
||||
# Set the default Django settings module for the 'celery' program.
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.development")
|
||||
# Set the Django settings module for the 'celery' program.
|
||||
if "DJANGO_SETTINGS_MODULE" not in os.environ:
|
||||
raise RuntimeError(
|
||||
"DJANGO_SETTINGS_MODULE is not set. "
|
||||
"Export it explicitly before starting Celery "
|
||||
"(e.g., config.settings.production or config.settings.development)."
|
||||
)
|
||||
|
||||
app = Celery("project")
|
||||
|
||||
@@ -24,17 +29,24 @@ app.autodiscover_tasks()
|
||||
|
||||
# Configure Celery Beat schedule
|
||||
app.conf.beat_schedule = {
|
||||
"check-pending-scraping-jobs": {
|
||||
"task": "apps.scraping.tasks.check_pending_jobs",
|
||||
"schedule": 300.0, # Every 5 minutes
|
||||
# Парсинг сертификатов промышленного производства - каждый день в 3:00
|
||||
"parse-industrial-production-daily": {
|
||||
"task": "apps.parsers.tasks.parse_industrial_production",
|
||||
"schedule": 86400.0, # Every 24 hours
|
||||
},
|
||||
"process-extracted-data": {
|
||||
"task": "apps.data_processor.tasks.process_extracted_data",
|
||||
"schedule": 600.0, # Every 10 minutes
|
||||
# Парсинг реестра производителей - каждый день в 4:00
|
||||
"parse-manufactures-daily": {
|
||||
"task": "apps.parsers.tasks.parse_manufactures",
|
||||
"schedule": 86400.0, # Every 24 hours
|
||||
},
|
||||
# Сканирование папки FNS - каждые 5 минут
|
||||
"scan-fns-directory": {
|
||||
"task": "apps.parsers.tasks.scan_fns_directory",
|
||||
"schedule": 300.0, # Every 5 minutes
|
||||
},
|
||||
}
|
||||
|
||||
app.conf.timezone = "UTC"
|
||||
app.conf.timezone = "Europe/Moscow"
|
||||
|
||||
|
||||
@app.task(bind=True)
|
||||
|
||||
Reference in New Issue
Block a user