Skip to main content

rebuild_post_content_html

Function rebuild_post_content_html 

Source
pub async fn rebuild_post_content_html(
    post_id: i32,
) -> Result<CreatePostResponse, ServerFnError>
Expand description

重新渲染指定文章的 content_html 与 toc_html。

从数据库读取 content_md(FOR UPDATE 锁行,避免并发编辑产生非可重复读), 在阻塞线程池渲染 HTML,并更新 content_html / toc_html / word_count / reading_time。 仅 admin 可调用;成功后按影响范围失效文章列表、slug 单篇与搜索缓存。

§Handler information

  • Method: post
  • Path: <auto>