refactor: standardize article header layout in UI and increase worker pool capacity

This commit is contained in:
2026-08-25 23:01:40 -07:00
parent 83c70cc3b9
commit 9bc3423009
6 changed files with 175 additions and 85 deletions
+22 -1
View File
@@ -5,6 +5,7 @@ import (
"net/http"
"os"
"os/signal"
"strings"
"syscall"
"time"
@@ -49,7 +50,7 @@ func main() {
// 3. Initialize EventBus, WorkerPool, and Action Handlers
bus := events.NewEventBus()
pool := worker.NewPool(database, bus, 5, 100)
pool := worker.NewPool(database, bus, 5, 1000)
// Register Core Action Handlers
scraper := readability.NewScraper(15 * time.Second)
@@ -68,6 +69,26 @@ func main() {
if contentType == "" {
contentType = "text"
}
// If key == "tags", merge with existing tags so multiple rules append tags
if key == "tags" {
existingVariant, err := database.GetVariant(entry.ID, "tags")
if err == nil && existingVariant != nil && existingVariant.TextValue != "" {
existingTags := strings.Split(existingVariant.TextValue, ",")
newTags := strings.Split(val, ",")
tagSet := make(map[string]bool)
var merged []string
for _, t := range append(existingTags, newTags...) {
trimmed := strings.TrimSpace(t)
if trimmed != "" && !tagSet[strings.ToLower(trimmed)] {
tagSet[strings.ToLower(trimmed)] = true
merged = append(merged, trimmed)
}
}
val = strings.Join(merged, ", ")
}
}
variant := models.EntryVariant{
EntryID: entry.ID,
VariantKey: key,