You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: gate inline cleanup behind ENABLE_INLINE_CONFERENCE_CLEANUP flag
The background thread in AppConfig.ready() only dedupes within one
process (threading lock). With multiple gunicorn workers, each worker
forks a separate process and runs its own cleanup loop.
Gate the inline loop behind ENABLE_INLINE_CONFERENCE_CLEANUP=true so
it's opt-in for dev/single-process. Production should use an external
scheduler to run the management command.
Also added cleanup documentation to README with dev vs production
guidance.
Copy file name to clipboardExpand all lines: README.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,6 +109,28 @@ The table below lists all environment variables used by the API. Variables marke
109
109
|`GOOGLE_TASK_QUEUE_NAME`| No | - | Name of the Cloud Tasks queue (e.g. `queue-1`). Required when `USE_GOOGLE_TASK_QUEUE` is `True`. |
110
110
|`APP_ENGINE_LOCATION`| No | - | App Engine location (e.g. `us-east1`). Required when `USE_GOOGLE_TASK_QUEUE` is `True`. |
111
111
|`TASK_QUEUE_DOMAIN`| No | - | Domain for task queue callbacks (e.g. `https://api.example.com/`). Required when `USE_GOOGLE_TASK_QUEUE` is `True`. |
112
+
|**Conference Cleanup**||||
113
+
|`CONFERENCE_TIMEOUT_HOURS`| No |`4`| Close ongoing conferences with no activity for this many hours. |
114
+
|`ENABLE_INLINE_CONFERENCE_CLEANUP`| No |`false`| Set to `true` to run cleanup in a background thread (dev/single-process only). |
115
+
|`CONFERENCE_CLEANUP_INTERVAL_SECONDS`| No |`3600`| How often the inline cleanup runs in seconds. Set to `0` to disable. Only applies when `ENABLE_INLINE_CONFERENCE_CLEANUP` is `true`. |
116
+
117
+
### Stale Conference Cleanup
118
+
119
+
Conferences can get stuck as "Ongoing" if the client fails to send the end signal (browser tab closed, network drop). The `cleanup_stale_conferences` management command closes conferences with no activity for a configurable period.
python manage.py cleanup_stale_conferences --dry-run # preview without changes
125
+
```
126
+
127
+
**Development:** Set `ENABLE_INLINE_CONFERENCE_CLEANUP=true` to run the cleanup automatically in a background thread inside the API process.
128
+
129
+
**Production (multi-worker):** Do not use the inline loop with multiple gunicorn workers as each worker runs its own cleanup loop. Instead, use an external scheduler:
0 commit comments