From b792d09b0d985bc71a4d86b6248ce4c33d80fe6e Mon Sep 17 00:00:00 2001 From: Dmitriy Belyaev Date: Sat, 27 Jun 2026 14:11:59 +0300 Subject: [PATCH] docs: complete video cleanup rollout --- docs/superpowers/plans/2026-06-27-video-cleanup.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/superpowers/plans/2026-06-27-video-cleanup.md b/docs/superpowers/plans/2026-06-27-video-cleanup.md index 8495e65..45b312e 100644 --- a/docs/superpowers/plans/2026-06-27-video-cleanup.md +++ b/docs/superpowers/plans/2026-06-27-video-cleanup.md @@ -15,11 +15,11 @@ **Files:** - Modify: `app/worker.py` -- [ ] **Step 1: Import directory removal support** +- [x] **Step 1: Import directory removal support** Add `import shutil` alongside the existing standard-library imports. -- [ ] **Step 2: Add the cleanup helper** +- [x] **Step 2: Add the cleanup helper** Implement a helper with this contract: @@ -37,11 +37,11 @@ def cleanup_uploaded_video_artifacts(video: Video) -> None: video.local_cover_path = None ``` -- [ ] **Step 3: Invoke cleanup after successful upload** +- [x] **Step 3: Invoke cleanup after successful upload** After assigning `video.ok_video_id` and setting `video.status = "ok_uploaded"`, call the helper inside a `try/except OSError` block. Log failures and retain the successful upload status. -- [ ] **Step 4: Compile the worker** +- [x] **Step 4: Compile the worker** Run: `python3 -m compileall app/worker.py` @@ -52,14 +52,14 @@ Expected: `Compiling 'app/worker.py'...` with exit code 0. **Files:** - Deploy: `app/worker.py` to `/var/www/bots/vk2ok/app/worker.py` -- [ ] **Step 1: Rebuild services** +- [x] **Step 1: Rebuild services** Run `docker compose up -d --build api worker beat` in `/var/www/bots/vk2ok`. -- [ ] **Step 2: Clean existing uploaded artifacts** +- [x] **Step 2: Clean existing uploaded artifacts** Inside the API container, query `Video` rows where `ok_video_id IS NOT NULL` and either local path is set. Apply `cleanup_uploaded_video_artifacts` and commit each successful cleanup. -- [ ] **Step 3: Verify health and storage state** +- [x] **Step 3: Verify health and storage state** Confirm all containers are running, Celery recovery returns normally, uploaded rows have null local paths, and no open publication work remains.