From 1a285a61c6b6b1294897ebef8b3a9c6b79bee309 Mon Sep 17 00:00:00 2001 From: erjemin Date: Sun, 23 Aug 2026 17:23:00 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BC=D0=B8=D0=BD=D0=BE=D1=80:=20Custom=20Comm?= =?UTF-8?q?and=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B8=D0=BC=D0=B5=D0=BD=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20rescore=5Fhypn0=5Fitems=20->?= =?UTF-8?q?=20rescore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _blueprint/management-commands.md | 10 ++-- _blueprint/plan-draft.md | 58 +++++++++---------- .../{rescore_hypn0_items.py => rescore.py} | 0 3 files changed, 34 insertions(+), 34 deletions(-) rename hypn0/hypn0_site/management/commands/{rescore_hypn0_items.py => rescore.py} (100%) diff --git a/_blueprint/management-commands.md b/_blueprint/management-commands.md index 4bb69a2..1ddef18 100644 --- a/_blueprint/management-commands.md +++ b/_blueprint/management-commands.md @@ -4,18 +4,18 @@ --- -## 1. `rescore_hypn0_items` — Пакетный пересчет рейтинга и детекция аномалий +## 1. `rescore` — Пакетный пересчет рейтинга и детекция аномалий -- **Путь:** `hypn0/hypn0_site/management/commands/rescore_hypn0_items.py` +- **Путь:** `../hypn0/hypn0_site/management/commands/rescore.py` - **Назначение:** Пакетный фоновый пересчет рейтинга популярности (`f_score`) для всех активных картин и выявление аномалий (накрутка лайков / скоординированный шейминг). ### Базовый запуск: ```bash # Рабочий запуск -poetry run python hypn0/manage.py rescore_hypn0_items +poetry run python hypn0/manage.py rescore # Тестовый прогон (без записи изменений в базу) -poetry run python hypn0/manage.py rescore_hypn0_items --dry-run +poetry run python hypn0/manage.py rescore --dry-run ``` --- @@ -72,7 +72,7 @@ poetry run python hypn0/manage.py rescore_hypn0_items --dry-run ### Когда требуется запуск: 1. При смене или ротации `HASHIDS_SALT` в `.env` / `settings.py`. -2. При переносе/миграции базы данных между разными окружениями (Dev $\rightarrow$ Prod). +2. При переносе/миграции базы данных между разными окружениями (Dev -> Prod). 3. При обнаружении записей с пустыми или устаревшими `s_hash_id`. ### Базовый запуск: diff --git a/_blueprint/plan-draft.md b/_blueprint/plan-draft.md index a020cf7..46aeaff 100644 --- a/_blueprint/plan-draft.md +++ b/_blueprint/plan-draft.md @@ -558,35 +558,35 @@ CLI больше не нужен. ## Файлы для создания (итого) -| Файл | Назначение | -|---------------------------------------------------------------|---------------------------------| -| `hypn0/manage.py` | Django CLI | -| `hypn0/hypn0/__init__.py` | Settings pkg | -| `hypn0/hypn0/settings.py` | Конфиг | -| `hypn0/hypn0/urls.py` | URL routing | -| `hypn0/hypn0/wsgi.py` | WSGI entry | -| `hypn0/hypn0/templates/base.html` | Базовый шаблон | -| `hypn0/hypn0_site/__init__.py` | App pkg | -| `hypn0/hypn0_site/urls.py` | URL app | -| `hypn0/hypn0_site/views.py` | Views | -| `hypn0/hypn0_site/forms.py` | Forms | -| `hypn0/hypn0_site/models.py` | TbHypn0Item, TbVote... | -| `hypn0/hypn0_site/services/halftone.py` | Ядро | -| `hypn0/hypn0_site/templates/halftone/index.html` | Главная | -| `hypn0/hypn0_site/management/commands/rescore_hypn0_items.py` | Скоринг и детекция аномалий | -| `hypn0/hypn0_site/management/commands/rehash.py` | Синхронизация s_hash_id с солью | -| `hypn0/hypn0_site/management/commands/cleanup_storage.py` | Очистка SmartRetention | -| `hypn0/hypn0_site/management/commands/cleanup_reports.py` | Очистка по жалобам | -| `_blueprint/management-commands.md` | Документация CLI-команд | -| `public/static/css/site.css` | Стили | -| `public/static/js/site.js` | JS | -| `.env.sample` | Env template | -| `Dockerfile` | Сборка | -| `docker-compose.local.yml` | Dev | -| `docker-compose.prod.yml` | Prod | -| `config/nginx/hypn0-app--external-nginx.conf` | Nginx | -| `.gitea/workflows/docker-publish.yaml` | CI/CD | -| `database/.gitignore` | Игнор БД | +| Файл | Назначение | +|-----------------------------------------------------------|---------------------------------| +| `hypn0/manage.py` | Django CLI | +| `hypn0/hypn0/__init__.py` | Settings pkg | +| `hypn0/hypn0/settings.py` | Конфиг | +| `hypn0/hypn0/urls.py` | URL routing | +| `hypn0/hypn0/wsgi.py` | WSGI entry | +| `hypn0/hypn0/templates/base.html` | Базовый шаблон | +| `hypn0/hypn0_site/__init__.py` | App pkg | +| `hypn0/hypn0_site/urls.py` | URL app | +| `hypn0/hypn0_site/views.py` | Views | +| `hypn0/hypn0_site/forms.py` | Forms | +| `hypn0/hypn0_site/models.py` | TbHypn0Item, TbVote... | +| `hypn0/hypn0_site/services/halftone.py` | Ядро | +| `hypn0/hypn0_site/templates/halftone/index.html` | Главная | +| `hypn0/hypn0_site/management/commands/rescore.py` | Скоринг и детекция аномалий | +| `hypn0/hypn0_site/management/commands/rehash.py` | Синхронизация s_hash_id с солью | +| `hypn0/hypn0_site/management/commands/cleanup_storage.py` | Очистка SmartRetention | +| `hypn0/hypn0_site/management/commands/cleanup_reports.py` | Очистка по жалобам | +| `_blueprint/management-commands.md` | Документация CLI-команд | +| `public/static/css/site.css` | Стили | +| `public/static/js/site.js` | JS | +| `.env.sample` | Env template | +| `Dockerfile` | Сборка | +| `docker-compose.local.yml` | Dev | +| `docker-compose.prod.yml` | Prod | +| `config/nginx/hypn0-app--external-nginx.conf` | Nginx | +| `.gitea/workflows/docker-publish.yaml` | CI/CD | +| `database/.gitignore` | Игнор БД | ## Файлы для модификации diff --git a/hypn0/hypn0_site/management/commands/rescore_hypn0_items.py b/hypn0/hypn0_site/management/commands/rescore.py similarity index 100% rename from hypn0/hypn0_site/management/commands/rescore_hypn0_items.py rename to hypn0/hypn0_site/management/commands/rescore.py