From 3bd2ac7fa8338d1db110cadf55bae6a59691ce61 Mon Sep 17 00:00:00 2001 From: hermes Date: Sun, 25 Oct 2026 14:51:56 +0000 Subject: [PATCH] =?UTF-8?q?fix(archive):=20page=5Fsize=20500=E2=86=92100?= =?UTF-8?q?=20=E2=80=94=20himalaya=20envelope=20list=20=D0=B7=D0=B0=D0=B2?= =?UTF-8?q?=D0=B8=D1=81=D0=B0=D0=BB=20=D0=BD=D0=B0=20INBOX=2016k+=20=D0=B8?= =?UTF-8?q?=20=D0=B2=D0=BE=D0=B7=D0=B2=D1=80=D0=B0=D1=89=D0=B0=D0=BB=20?= =?UTF-8?q?=D0=BF=D1=83=D1=81=D1=82=D0=BE=20(=D0=BD=D0=BE=D0=B2=D1=8B?= =?UTF-8?q?=D0=B5=20=D0=BF=D0=B8=D1=81=D1=8C=D0=BC=D0=B0=20=D0=BD=D0=B5=20?= =?UTF-8?q?=D0=BA=D0=B0=D1=87=D0=B0=D0=BB=D0=B8=D1=81=D1=8C=20=D1=81=2019?= =?UTF-8?q?=20=D1=81=D0=B5=D0=BD).=20feat(cron):=20mail-index.sh=20+=20cro?= =?UTF-8?q?n=20mail-index-incremental=20(*/10)=20=E2=80=94=20=D0=B8=D0=BD?= =?UTF-8?q?=D0=B4=D0=B5=D0=BA=D1=81=20=D0=BD=D0=B5=20=D0=BE=D0=B1=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=D0=BB=D1=8F=D0=BB=D1=81=D1=8F,=20UI=20=D0=BD=D0=B5?= =?UTF-8?q?=20=D0=B2=D0=B8=D0=B4=D0=B5=D0=BB=20=D0=B0=D1=80=D1=85=D0=B8?= =?UTF-8?q?=D0=B2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/mail-index.sh | 12 ++++++++++++ scripts/mail_archive.py | 2 +- webui/app.py | 2 +- webui/static/css/app.css | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) create mode 100755 scripts/mail-index.sh diff --git a/scripts/mail-index.sh b/scripts/mail-index.sh new file mode 100755 index 0000000..3e43b17 --- /dev/null +++ b/scripts/mail-index.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Инкрементальная индексация архива писем (mail_index.py --incremental) +# Обёртка для Hermes cron: добавляет himalaya и python в PATH. + +export PATH="$HOME/.local/bin:$HOME/bin:/usr/local/bin:/usr/bin:/bin" +export PYTHONUNBUFFERED=1 + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" + +exec python3 -u "$SCRIPT_DIR/mail_index.py" --incremental "$@" diff --git a/scripts/mail_archive.py b/scripts/mail_archive.py index 717e555..e230b64 100755 --- a/scripts/mail_archive.py +++ b/scripts/mail_archive.py @@ -262,7 +262,7 @@ def get_envelopes(folder, limit=100, last_uid=0): """ envelopes = [] page = 1 - page_size = 500 # больше писем за страницу = меньше запросов + page_size = 100 # 500 зависает на большом INBOX (Exchange, 16k+ писем) — 2+ мин и пустой ответ while True: try: diff --git a/webui/app.py b/webui/app.py index 2260330..a90649f 100644 --- a/webui/app.py +++ b/webui/app.py @@ -383,7 +383,7 @@ def _render_tasks_card() -> HTMLResponse: sid = "'" + t["summary"].replace("'", "\\'") + "'" xdata = '{{edit:{},editing:false}}'.format(sid) items.append(f'''
- +
{t['summary']}