fix(archive): page_size 500→100 — himalaya envelope list зависал на INBOX 16k+ и возвращал пусто (новые письма не качались с 19 сен). feat(cron): mail-index.sh + cron mail-index-incremental (*/10) — индекс не обновлялся, UI не видел архив.

This commit is contained in:
2026-10-25 14:51:56 +00:00
parent d6a055a29f
commit 3bd2ac7fa8
4 changed files with 15 additions and 3 deletions
+12
View File
@@ -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 "$@"
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -383,7 +383,7 @@ def _render_tasks_card() -> HTMLResponse:
sid = "'" + t["summary"].replace("'", "\\'") + "'"
xdata = '{{edit:{},editing:false}}'.format(sid)
items.append(f'''<div class="tk {'done' if t['completed'] else ''}" x-data="{xdata}">
<a class="chk" href="#" hx-post="/api/task/{t['uid']}/toggle" hx-target="closest .card" hx-swap="innerHTML" onclick="event.preventDefault()"></a>
<span class="chk" onclick="event.stopPropagation();fetch('/api/task/{t['uid']}/toggle',{{method:'POST',headers:{{'Content-Type':'application/x-www-form-urlencoded','HX-Request':'true'}}}}).then(function(r){{return r.text();}}).then(function(h){{var c=document.querySelector('.card');if(c)c.innerHTML=h;}}).catch(function(e){{console.error(e)}});return false"></span>
<div class="txt">
<div class="t" x-on:click="edit={sid};editing=true">{t['summary']}</div>
<template x-if="editing">
+1 -1
View File
@@ -195,7 +195,7 @@ body.f3 .c3{flex:1}
.tk .txt .d{font-size:11px;color:var(--fg3);margin-top:1px}
.tk.done .t{text-decoration:line-through;color:var(--fg3)}
.tk.done .chk{background:var(--accent);border-color:var(--accent)}
.tk.done .chk::after{content:'\u2713';color:var(--bg);font-size:11px;line-height:15px;text-align:center;width:100%;display:block;pointer-events:none}
.tk.done .chk::after{content:'\u2713';color:var(--bg);font-size:11px;line-height:15px;text-align:center;width:100%;height:100%;display:flex;align-items:center;justify-content:center;pointer-events:none}
/* кнопка «Создать задачу» */
.pb-btn{background:none;border:1px solid var(--border);color:var(--fg);cursor:pointer;font-size:16px;padding:3px 8px;border-radius:6px;line-height:1}
.pb-btn:hover{background:var(--hover);border-color:var(--accent)}