Internal
Public Access
Replace complex notification system with a simple daily email: - Send ONE email per day between 6-9 AM in user's timezone - Show tasks due today and overdue tasks - Only send if user has email_notifications enabled - Remove all push notification logic - Keep recurring task processor (runs daily at midnight) This makes notifications much simpler and less intrusive while still providing value to users. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
39 lines
986 B
Python
39 lines
986 B
Python
"""
|
|
Celery configuration for KeepItGoing.
|
|
"""
|
|
|
|
import logging
|
|
import os
|
|
from celery import Celery
|
|
from celery.schedules import crontab
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
# Set the default Django settings module
|
|
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
|
|
|
|
app = Celery('keepitgoing')
|
|
|
|
# Load config from Django settings
|
|
app.config_from_object('django.conf:settings', namespace='CELERY')
|
|
|
|
# Auto-discover tasks in all installed apps
|
|
app.autodiscover_tasks()
|
|
|
|
# Celery Beat schedule for periodic tasks
|
|
app.conf.beat_schedule = {
|
|
'send-daily-task-email': {
|
|
'task': 'notifications.tasks.send_daily_task_email',
|
|
'schedule': crontab(hour=6, minute=0), # Daily at 6 AM UTC
|
|
},
|
|
'process-recurring-tasks': {
|
|
'task': 'notifications.tasks.process_recurring_tasks',
|
|
'schedule': crontab(hour=0, minute=0), # Daily at midnight
|
|
},
|
|
}
|
|
|
|
|
|
@app.task(bind=True)
|
|
def debug_task(self):
|
|
logger.debug(f'Request: {self.request!r}')
|