71d4126e94
fix(posts): wrap rebuild_content_html in single transaction
...
整批 UPDATE 纳入事务,任一写入失败整批回滚,避免产生「部分文章已重建」的
中间态(M5)。渲染失败(spawn_blocking panic)仍跳过该条不进入事务操作。
失败时返回 rebuilt:0 明确告知整批回滚。
2026-06-18 13:32:55 +08:00
033b89ccb8
perf(posts): offload Markdown rendering to spawn_blocking
...
create/update/rebuild 三处 Markdown 渲染(含 syntect 高亮)移到阻塞
线程池。rebuild 用 spawn_blocking 的 JoinError 替代 catch_unwind 捕获
渲染 panic,避免单条记录拖垮整批。
2026-06-18 11:18:36 +08:00
3ee39d910c
refactor(ssr): remove unused per-slug/per-tag generation counters
2026-06-18 10:30:07 +08:00
c780247d17
feat(posts): invalidate search cache on writes
2026-06-17 17:21:01 +08:00
1092fbb3ce
fix(posts): ensure rebuild invalidates tag posts cache
2026-06-17 16:44:32 +08:00
c03093fc8b
refactor(posts): use precise cache invalidation in rebuild
2026-06-17 16:37:20 +08:00
15e7e2578d
refactor(utils): extract reading_time helper
2026-06-17 16:25:22 +08:00
1eedab8f21
perf(posts): remove content_md from list/search SQL, read stored word counts
2026-06-17 16:06:27 +08:00
c60e4e08d7
fix(build): 用 cfg gate 消除 WASM 构建的 27 个假阳性 warning
...
CI / check (push) Failing after 5m17s
CI / build (push) Has been skipped
Dioxus fullstack 在 WASM 构建中会剥离 #[server] 函数体,导致仅在
函数体内使用的导入/函数/常量被误报为 unused / dead_code。
- 仅在服务端使用的导入加 #[cfg(feature="server")]:get_conn、
PostStatus/PostStats/Tag、password/session、User/UserRole、
slug.rs 的 dioxus::prelude(保留 ServerFnError 给 server-gated
的 ensure_unique_slug)
- 仅在服务端使用的项加 cfg gate:clamp_pagination 及其常量、
rebuild 常量、format_relative_time、compute_content_hash、
CommentStatus::from_str
- CommentCountResponse/PendingCommentsResponse 出现在 #[server]
签名中(WASM 保留),无法 gate,改用 #[allow(dead_code)],
与现有 CreateCommentRequest 处理一致
make build 零 warning,cargo test 299 passed。
2026-06-16 11:29:18 +08:00
a785683fc6
docs(posts): 补充中文注释
2026-06-12 18:50:17 +08:00
ee6aaf179c
feat(posts): add batch limit and error handling to rebuild_content_html
2026-06-12 11:44:53 +08:00
2e9d123396
feat(posts): add rebuild_content_html server function
...
New admin-only server function that re-renders content_html and
toc_html for posts from their content_md:
- rebuild_all=false: only processes posts where content_html IS NULL
- rebuild_all=true: processes all non-deleted posts
- Processes rows one at a time to avoid table locks
- Invalidates post list and stats caches after rebuild
2026-06-12 10:35:59 +08:00