Changeset 3dd99d3 in Klonkt for src/services/Scheduler.js
- Timestamp:
- 06/25/2026 09:52:25 AM (3 months ago)
- Branches:
- main
- Children:
- c648b04
- Parents:
- 4b5223f
- File:
-
- 1 edited
-
src/services/Scheduler.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/services/Scheduler.js
r4b5223f r3dd99d3 24 24 "UPDATE posts SET status = 'published', published_at = COALESCE(published_at, publish_at, CURRENT_TIMESTAMP) WHERE id = ?" 25 25 ); 26 const ftsDel = db.prepare('DELETE FROM posts_fts WHERE post_id = ?'); 26 27 const fts = db.prepare('INSERT INTO posts_fts(content, title, author, post_id) VALUES (?, ?, ?, ?)'); 27 28 const siteStmt = db.prepare('SELECT * FROM sites WHERE id = ?'); 28 29 for (const p of due) { 29 30 upd.run(p.id); 30 try { fts.run(HtmlSanitizerService.toPlainText(p.content || ''), p.title || '', p.username || '', p.id); } catch { /* FTS failure is non-fatal */ } 31 // Delete-before-insert so a re-scheduled (previously published) post doesn't 32 // get a duplicate FTS row → duplicate search hits. 33 try { ftsDel.run(p.id); fts.run(HtmlSanitizerService.toPlainText(p.content || ''), p.title || '', p.username || '', p.id); } catch { /* FTS failure is non-fatal */ } 31 34 // ActivityPub: federate the now-published post to followers. 32 35 if (!p.fan_only) {
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)