POST /api/drive/connections/<id>/sync/ enqueues via Django 6 Tasks (drive_tasks.enqueue_drive_sync) and returns 202 with last_sync_status=pending
Webhooks + manage.py sync_drive_connections use the same enqueue path (--sync-now for inline/cron)
With default ImmediateBackend, sync still runs in-process but on a daemon thread so HTTP returns quickly; swap TASKS later for a durable worker
Duplicate syncs while already pending are skipped (unless force=True)
Test plan
manage.py test chat_backend.tests.test_drive_tasks chat_backend.tests.test_views_drive chat_backend.tests.test_management_drive_sync
Manual: Sync now returns fast; connection flips pending → ok/error
Manual: Google Drive API disabled → last_sync_status=error + message in last_sync_error
Manual: second Sync while pending does not stack jobs
## Summary
- Closes [#57](https://git.aimloperations.com/ai_ml_operations/chat_backend/issues/57)
- Companion FE: [chat_web_app#90](https://git.aimloperations.com/ai_ml_operations/chat_web_app/issues/90) / [PR #91](https://git.aimloperations.com/ai_ml_operations/chat_web_app/pulls/91)
- `POST /api/drive/connections/<id>/sync/` enqueues via Django 6 Tasks (`drive_tasks.enqueue_drive_sync`) and returns **202** with `last_sync_status=pending`
- Webhooks + `manage.py sync_drive_connections` use the same enqueue path (`--sync-now` for inline/cron)
- With default `ImmediateBackend`, sync still runs in-process but on a **daemon thread** so HTTP returns quickly; swap `TASKS` later for a durable worker
- Duplicate syncs while already `pending` are skipped (unless `force=True`)
## Test plan
- [x] `manage.py test chat_backend.tests.test_drive_tasks chat_backend.tests.test_views_drive chat_backend.tests.test_management_drive_sync`
- [ ] Manual: Sync now returns fast; connection flips pending → ok/error
- [ ] Manual: Google Drive API disabled → `last_sync_status=error` + message in `last_sync_error`
- [ ] Manual: second Sync while pending does not stack jobs
Sync now / webhooks / cron share enqueue_drive_sync so HTTP no longer
blocks on Drive list/ingest. ImmediateBackend still runs in-process via
a background thread; status and errors stay on the connection for FE poll.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
POST /api/drive/connections/<id>/sync/enqueues via Django 6 Tasks (drive_tasks.enqueue_drive_sync) and returns 202 withlast_sync_status=pendingmanage.py sync_drive_connectionsuse the same enqueue path (--sync-nowfor inline/cron)ImmediateBackend, sync still runs in-process but on a daemon thread so HTTP returns quickly; swapTASKSlater for a durable workerpendingare skipped (unlessforce=True)Test plan
manage.py test chat_backend.tests.test_drive_tasks chat_backend.tests.test_views_drive chat_backend.tests.test_management_drive_synclast_sync_status=error+ message inlast_sync_error