-
Notifications
You must be signed in to change notification settings - Fork 44
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
The WOPI configuration task (configure_wopi_clients) is registered using add_periodic_task() in wopi/tasks/configure_wopi.py, but the application is configured to use DatabaseScheduler in settings.py. These are incompatible - the task never runs automatically.
Evidence:
-
drive/settings.py:483 configures:
CELERY_BEAT_SCHEDULER = "django_celery_beat.schedulers:DatabaseScheduler" -
wopi/tasks/configure_wopi.py:20-28 registers the task using:
@celery_app.on_after_configure.connect
def setup_periodic_tasks(sender: Celery, **kwargs):
sender.add_periodic_task(
crontab(minute="0"),
configure_wopi_clients.s(),
name="configure_wopi_clients_every_hour",
)
- add_periodic_task() only works with the default in-memory scheduler, not DatabaseScheduler
Impact:
- WOPI configuration is never cached in Redis
- is_wopi_supported returns False for all files
- Collabora/OnlyOffice integration appears broken
- Users must manually run python manage.py trigger_wopi_configuration after every deployment
Suggested Fix:
Add a data migration or AppConfig.ready() hook to register the task in the database:
from django_celery_beat.models import PeriodicTask, CrontabSchedule
schedule, _ = CrontabSchedule.objects.get_or_create(minute='0', hour='*')
PeriodicTask.objects.update_or_create(
name='configure_wopi_clients_every_hour',
defaults={
'task': 'wopi.tasks.configure_wopi.configure_wopi_clients',
'crontab': schedule,
'enabled': True,
}
)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working