Compare commits

...

4 Commits

Author SHA1 Message Date
zheromiku 9258aa8273 fix(reconciliation): worker 在对账接线时也要注册 reconciliation.run
build / build (push) Successful in 3m5s
候选(9dddda84)实测:批次能建、入队也成功(jobs 里有 pending 行),但 worker
从不认领——worker_heartbeats.job_types 里根本没有 reconciliation.run。
原因:该 handler 注册在 workerHandlers 的测试库取件块里,而这一块在
!TEST_WEKNORA_ENABLED 时直接 return,于是只开 RECONCILIATION_ENABLED 的候选
只有 API 接线、worker 空转,批次停在 running 直到 6h 僵死回收。

把注册移到那个早退之前:只依赖 reconciliationService(租户 Key 走知识库绑定),
与旧取件/上传链路解耦。
2026-12-01 20:11:59 +08:00
zheromiku fe7edea1a3 fix(reconciliation): 对账任务入队 id 超长导致每批 queue_unavailable
build / build (push) Successful in 2m18s
enqueueRun 用 "job-" + run_id 当 jobs.id,而 jobs.id 是 VARCHAR(36);run_id 本身
已是 36 字符(rec- + 32 位 hex),拼出 40 字符,INSERT 必然失败,批次在 claim 之后
立刻被记成 failed/queue_unavailable——候选库里 19:37 起所有批次都是这个状态,C-101
起的用例全部无法开始。

改为 job 自带 "job-"+32 位 hex 的 id(36 字符),幂等仍由唯一 idempotency_key
(reconciliation-run:<run_id>)保证。补单测:CreateRun 入队请求 id 必须正好 36 字符、
type/idempotency_key/payload 与 run 一致。

验证:go test ./internal/reconciliation/ 通过;make verify 17 项 = 16 success + identity skipped。
2026-12-01 19:47:00 +08:00
zheromiku f4b3f4c4c8 fix(reconciliation): 定时批占位语句修 42P08,真实 PG 上首次 claim 即可建批
build / build (push) Successful in 2m26s
白盒在真实 PostgreSQL 上跑新集成用例时,ClaimScheduledReconciliationRun 首次
claim 就报 inconsistent types deduced for parameter $2 (42P08):同一个 KB id
既进 INSERT 目标列(varchar(255))又参与子查询比较(varchar),参数被推断成两种
类型。把比较侧改成独立参数 $7,并在语句上方写明原因。

存量缺陷,改动前同样报错(reconciliation_schedules 一直建不出批次,C-105 无法通过)。

验证:
- TEST_DB 指向一次性 PostgreSQL 16,TestScheduledReconciliationClaimsOncePerDayAfterFailure 通过
  (首日占位一次;失败后同日不再建;次日可建)
- TestReconciliationRunUniquenessStaleAndRetentionIntegration 同库通过
- make verify 17 项 = 16 success + identity skipped
2026-12-01 19:12:00 +08:00
zheromiku 082f77fc18 fix(reconciliation): R6 改用 removal_candidates 视图,定时批每日只占一个名额
build / build (push) Successful in 2m28s
白盒补充复核提出的三项:
- P1 R6 与 /monitor/overview「需下架」计数口径不一致:R6 原先只在扫描结果里存在
  且上游 parse_status=completed 时才生成,上游仍在 processing/finalizing 或单条读取
  失败导致扫描缺行时,总览有数、对账无记录(陷阱 15)。改为直接由 removal_candidates
  视图行生成,台账细节按 publication 回填,计数与总览同一来源;补单测覆盖
  「上游 processing」「扫描未见」两种差异。
- P2 定时批失败后每个 tick 都重建:每日占位只排除 running/succeeded,failed 不占位,
  一次失败当天会每分钟刷批。占位条件加入 failed,重跑改为显式手动触发;补 PG 集成用例。
- P2 队列不可用时前端显示 0 等待 · 0 运行:改为按 available 判定并显示不可用文案;
  补组件用例。
2026-12-01 18:56:05 +08:00
8 changed files with 259 additions and 30 deletions
+15 -11
View File
@@ -619,6 +619,21 @@ func workerHandlers(store *postgresstore.Store, config appconfig.Config, kbBindi
} }
handlers["source.scan.pp"] = handler.Handle handlers["source.scan.pp"] = handler.Handle
} }
// 导入对账的作业处理器只依赖对账服务本身(租户 Key 走知识库绑定),
// 与旧测试库取件/上传链路(TEST_WEKNORA_ENABLED)无关,必须在下面那个
// 早退之前注册;否则 RECONCILIATION_ENABLED=true 时候选只接线了 API,
// worker 从不认领 reconciliation.run,批次永远停在 running。
if reconciliationService != nil {
handlers["reconciliation.run"] = func(handlerCtx context.Context, job jobs.Job) error {
var payload struct {
RunID string `json:"run_id"`
}
if err := json.Unmarshal(job.Payload, &payload); err != nil || payload.RunID == "" {
return jobs.Permanent(jobs.ErrCodeHandlerFallback, errors.New("invalid reconciliation run payload"))
}
return reconciliationService.ExecuteRun(handlerCtx, payload.RunID)
}
}
if !config.TestWeKnoraEnabled || !config.LibraryWorkerRole.ExecutesSourceWork() { if !config.TestWeKnoraEnabled || !config.LibraryWorkerRole.ExecutesSourceWork() {
return handlers, nil return handlers, nil
} }
@@ -695,17 +710,6 @@ func workerHandlers(store *postgresstore.Store, config appconfig.Config, kbBindi
handlers["test.poll"] = poll.Handle handlers["test.poll"] = poll.Handle
handlers["test.validate"] = validate.Handle handlers["test.validate"] = validate.Handle
handlers["test.remove"] = remove.Handle handlers["test.remove"] = remove.Handle
if reconciliationService != nil {
handlers["reconciliation.run"] = func(handlerCtx context.Context, job jobs.Job) error {
var payload struct {
RunID string `json:"run_id"`
}
if err := json.Unmarshal(job.Payload, &payload); err != nil || payload.RunID == "" {
return jobs.Permanent(jobs.ErrCodeHandlerFallback, errors.New("invalid reconciliation run payload"))
}
return reconciliationService.ExecuteRun(handlerCtx, payload.RunID)
}
}
return handlers, nil return handlers, nil
} }
@@ -72,3 +72,43 @@ func TestReconciliationRunUniquenessStaleAndRetentionIntegration(t *testing.T) {
t.Fatalf("new findings=%d err=%v", count, err) t.Fatalf("new findings=%d err=%v", count, err)
} }
} }
// TestScheduledReconciliationClaimsOncePerDayAfterFailure freezes the operator
// expectation "每天最多一批": a failed scheduled batch keeps the day's slot so a
// transient upstream error cannot spawn a new batch on every scheduler tick.
// A retry after a failure is an explicit manual trigger.
func TestScheduledReconciliationClaimsOncePerDayAfterFailure(t *testing.T) {
url := isolatedIntegrationDatabaseURL(t, os.Getenv("TEST_DATABASE_URL"))
if url == "" {
t.Skip("TEST_DATABASE_URL is not set")
}
ctx := context.Background()
pool, err := pgxpool.New(ctx, url)
if err != nil {
t.Fatal(err)
}
defer pool.Close()
if err := ApplyMigrations(ctx, pool); err != nil {
t.Fatal(err)
}
store := NewStore(pool)
dayStart := time.Date(2026, 12, 1, 0, 0, 0, 0, time.UTC)
run := func(id string, started time.Time) governance.ReconciliationRun {
return governance.ReconciliationRun{ID: id, KBID: "kb-sched", State: "running", Trigger: "schedule",
StartedAt: started, Counts: governance.ReconciliationCounts{}}
}
first, claimed, err := store.ClaimScheduledReconciliationRun(ctx, run("sched-1", dayStart.Add(2*time.Hour)), dayStart, dayStart.Add(2*time.Hour))
if err != nil || !claimed {
t.Fatalf("first claim claimed=%t err=%v", claimed, err)
}
if err := store.FailReconciliationRun(ctx, first.ID, "remote_scan_failed", dayStart.Add(2*time.Minute)); err != nil {
t.Fatal(err)
}
if _, claimed, err := store.ClaimScheduledReconciliationRun(ctx, run("sched-2", dayStart.Add(3*time.Minute)), dayStart, dayStart.Add(3*time.Minute)); err != nil || claimed {
t.Fatalf("same-day reclaim after failure claimed=%t err=%v", claimed, err)
}
nextDay := dayStart.Add(24 * time.Hour)
if _, claimed, err := store.ClaimScheduledReconciliationRun(ctx, run("sched-3", nextDay.Add(2*time.Hour)), nextDay, nextDay.Add(2*time.Hour)); err != nil || !claimed {
t.Fatalf("next-day claim claimed=%t err=%v", claimed, err)
}
}
@@ -72,16 +72,19 @@ func (s *Store) ClaimScheduledReconciliationRun(ctx context.Context, run governa
if err != nil { if err != nil {
return governance.ReconciliationRun{}, false, err return governance.ReconciliationRun{}, false, err
} }
// The KB id is passed twice on purpose: PostgreSQL deduces varchar(255) for
// the INSERT target and varchar for the comparison, and one parameter used in
// both positions fails with 42P08 "inconsistent types deduced".
row := s.db.QueryRow(ctx, `INSERT INTO reconciliation_runs row := s.db.QueryRow(ctx, `INSERT INTO reconciliation_runs
(id,test_kb_id,state,trigger,started_at,counts,created_at) (id,test_kb_id,state,trigger,started_at,counts,created_at)
SELECT $1,$2,'running','schedule',$3,$4::jsonb,$5 SELECT $1,$2,'running','schedule',$3,$4::jsonb,$5
WHERE NOT EXISTS( WHERE NOT EXISTS(
SELECT 1 FROM reconciliation_runs SELECT 1 FROM reconciliation_runs
WHERE test_kb_id=$2 AND trigger='schedule' AND state IN ('running','succeeded') AND started_at >= $6 WHERE test_kb_id=$7 AND trigger='schedule' AND state IN ('running','succeeded','failed') AND started_at >= $6
) )
ON CONFLICT DO NOTHING ON CONFLICT DO NOTHING
RETURNING `+reconciliationRunColumns, RETURNING `+reconciliationRunColumns,
run.ID, run.KBID, run.StartedAt, counts, now, since) run.ID, run.KBID, run.StartedAt, counts, now, since, run.KBID)
claimed, err := scanReconciliationRun(row) claimed, err := scanReconciliationRun(row)
if errors.Is(err, pgx.ErrNoRows) { if errors.Is(err, pgx.ErrNoRows) {
return governance.ReconciliationRun{}, false, nil return governance.ReconciliationRun{}, false, nil
+46 -14
View File
@@ -278,11 +278,7 @@ func (s *Service) buildFindings(ctx context.Context, run governance.Reconciliati
if err != nil { if err != nil {
return nil, err return nil, err
} }
removalByPublication := make(map[string]bool, len(removal)) // 「需下架」的台账细节沿用上面按 publication 建的台账索引。
for _, row := range removal {
removalByPublication[row.PublicationID] = true
}
for _, row := range ledger { for _, row := range ledger {
if !expectedLive(row) { if !expectedLive(row) {
continue continue
@@ -305,15 +301,6 @@ func (s *Service) buildFindings(ctx context.Context, run governance.Reconciliati
if finding, ok := s.r4Finding(row, item, normalized); ok { if finding, ok := s.r4Finding(row, item, normalized); ok {
add(finding) add(finding)
} }
if removalByPublication[row.PublicationID] && item.ParseStatus == "completed" {
add(governance.ReconciliationFinding{
Type: "R6", PublicationID: row.PublicationID, DocumentID: row.KnowledgeID,
Title: row.Title, Path: row.Path, Source: row.SourceName, TargetScope: row.TargetScope,
LedgerState: row.ProcessingState, WeKnoraParseState: item.ParseStatus, NormalizedState: normalized,
LedgerSHA256: row.SHA256, EvidenceLevel: "none", SuggestedAction: "enter_removal",
Detail: "来源已判禁止导入,条目仍在测试库可检索",
})
}
if row.ProcessingState == "cancelled" { if row.ProcessingState == "cancelled" {
if normalized != "cancelled" && ageFromPointer(run.StartedAt, row.ProcessingStartedAt, row.UpdatedAt) >= s.grace { if normalized != "cancelled" && ageFromPointer(run.StartedAt, row.ProcessingStartedAt, row.UpdatedAt) >= s.grace {
add(r5Finding(row, item, normalized, "none", "台账已取消,WeKnora 仍有活动状态")) add(r5Finding(row, item, normalized, "none", "台账已取消,WeKnora 仍有活动状态"))
@@ -355,6 +342,51 @@ func (s *Service) buildFindings(ctx context.Context, run governance.Reconciliati
} }
} }
// R6: 应下架仍在。判定口径 = removal_candidates 视图(与 /monitor/overview 的
// 「需下架」共用同一实现,陷阱 15)。这里直接由视图行生成,不再附加「本轮扫描
// 见到该条目」「上游 parse_status=completed」这类只有对账侧才有的条件——上游仍在
// processing/finalizing、或单条读取失败导致扫描缺行时,两处数字就会永久不一致。
for _, row := range removal {
finding := governance.ReconciliationFinding{
Type: "R6", PublicationID: row.PublicationID, DocumentID: row.KnowledgeID,
Title: row.Title, Path: row.Path, Source: row.SourceName, TargetScope: row.TargetScope,
// 视图只收录 processing_state='completed' 的台账行。
LedgerState: "completed", EvidenceLevel: "none", SuggestedAction: "enter_removal",
Detail: "来源已判禁止导入,条目仍在测试库可检索",
}
if own, ok := ledgerByPublication[row.PublicationID]; ok {
if finding.DocumentID == "" {
finding.DocumentID = own.KnowledgeID
}
if finding.Title == "" {
finding.Title = own.Title
}
if finding.Path == "" {
finding.Path = own.Path
}
if finding.Source == "" {
finding.Source = own.SourceName
}
if finding.TargetScope == "" {
finding.TargetScope = own.TargetScope
}
if own.ProcessingState != "" {
finding.LedgerState = own.ProcessingState
}
finding.LedgerSHA256 = own.SHA256
}
if item, ok := byID[finding.DocumentID]; ok {
if normalized, known := normalizeParseStatus(item.ParseStatus); known {
finding.NormalizedState = normalized
}
finding.WeKnoraParseState = item.ParseStatus
finding.WeKnoraFileMD5 = normalizeMD5(item.FileHash)
} else if finding.DocumentID != "" {
finding.Detail = "来源已判禁止导入;本轮扫描未见该条目,计数仍与总览「需下架」一致"
}
add(finding)
}
// R8: one publication id maps to more than one live row. // R8: one publication id maps to more than one live row.
grouped := make(map[string][]weknora.Knowledge) grouped := make(map[string][]weknora.Knowledge)
for _, item := range items { for _, item := range items {
+8 -1
View File
@@ -214,8 +214,15 @@ func (s *Service) enqueueRun(ctx context.Context, runID string, now time.Time) e
if err != nil { if err != nil {
return err return err
} }
// jobs.id is VARCHAR(36) and the run id alone already fills it ("rec-" + 32 hex),
// so the job carries its own id; idempotency is guaranteed by the unique
// idempotency_key below, not by deriving the id from the run.
jobID, err := newID("job-")
if err != nil {
return err
}
_, err = s.queue.Enqueue(ctx, jobs.EnqueueRequest{ _, err = s.queue.Enqueue(ctx, jobs.EnqueueRequest{
ID: "job-" + runID, ID: jobID,
Type: "reconciliation.run", Type: "reconciliation.run",
Payload: payload, Payload: payload,
Priority: 5, Priority: 5,
+100
View File
@@ -13,6 +13,7 @@ import (
"time" "time"
"knowledge-governance/internal/governance" "knowledge-governance/internal/governance"
"knowledge-governance/internal/jobs"
"knowledge-governance/internal/platform/weknora" "knowledge-governance/internal/platform/weknora"
"knowledge-governance/internal/readiness" "knowledge-governance/internal/readiness"
"knowledge-governance/internal/weknoraaccess" "knowledge-governance/internal/weknoraaccess"
@@ -60,6 +61,7 @@ type fakeReconciliationStore struct {
removeHit bool removeHit bool
requeueDoc string requeueDoc string
orphan bool orphan bool
enqueued []jobs.EnqueueRequest
} }
func (f *fakeReconciliationStore) ReapStaleReconciliationRuns(context.Context, time.Time, time.Duration) (int64, error) { func (f *fakeReconciliationStore) ReapStaleReconciliationRuns(context.Context, time.Time, time.Duration) (int64, error) {
@@ -133,6 +135,11 @@ func (f *fakeReconciliationStore) MarkReconciliationOrphanRemoved(context.Contex
return nil return nil
} }
func (f *fakeReconciliationStore) Enqueue(_ context.Context, request jobs.EnqueueRequest, _ time.Time) (*jobs.Job, error) {
f.enqueued = append(f.enqueued, request)
return &jobs.Job{ID: request.ID}, nil
}
type fakeReconciliationRemote struct { type fakeReconciliationRemote struct {
items []weknora.Knowledge items []weknora.Knowledge
missing map[string]bool missing map[string]bool
@@ -480,3 +487,96 @@ func TestRemoveR2RechecksOwnershipAndTreats404AsSuccess(t *testing.T) {
t.Fatalf("owned removal err=%v hit=%t", err, store.removeHit) t.Fatalf("owned removal err=%v hit=%t", err, store.removeHit)
} }
} }
// TestExecuteRunR6UsesRemovalCandidatesViewOnly freezes 陷阱 15: R6 and
// /monitor/overview must read one implementation. An upstream document still
// processing/finalizing, or a single read that misses the listing, must not
// remove a row from the R6 set — otherwise the two pages report different
// "需下架" numbers for the same instant.
func TestExecuteRunR6UsesRemovalCandidatesViewOnly(t *testing.T) {
now := time.Date(2026, 12, 1, 12, 0, 0, 0, time.UTC)
ledger := []governance.ReconciliationLedgerRow{
{PublicationID: "pub-a", KnowledgeID: "doc-a", ProcessingState: "completed", RetrievalState: "unpublished", TargetScope: "internal", UpdatedAt: now.Add(-time.Hour)},
{PublicationID: "pub-b", KnowledgeID: "doc-b", ProcessingState: "completed", RetrievalState: "unpublished", TargetScope: "internal", UpdatedAt: now.Add(-time.Hour)},
{PublicationID: "pub-c", KnowledgeID: "doc-c", ProcessingState: "completed", RetrievalState: "unpublished", TargetScope: "internal", UpdatedAt: now.Add(-time.Hour)},
}
items := []weknora.Knowledge{
{ID: "doc-a", KnowledgeBaseID: "kb-1", Channel: "governance", ParseStatus: "processing", Metadata: map[string]any{"publication_id": "pub-a"}},
{ID: "doc-c", KnowledgeBaseID: "kb-1", Channel: "governance", ParseStatus: "completed", Metadata: map[string]any{"publication_id": "pub-c"}},
}
store := &fakeReconciliationStore{
run: governance.ReconciliationRun{ID: "run-r6", KBID: "kb-1", State: "running", Trigger: "manual", StartedAt: now},
ledger: ledger,
// The view is the authority: it lists three rows, including one whose
// upstream document is still processing and one absent from the scan.
removal: []governance.ReconciliationLedgerRow{
{PublicationID: "pub-a", KnowledgeID: "doc-a"},
{PublicationID: "pub-b", KnowledgeID: "doc-b"},
{PublicationID: "pub-c", KnowledgeID: "doc-c"},
},
}
remote := &fakeReconciliationRemote{items: items, missing: map[string]bool{"doc-b": true}}
service, err := New(Config{Store: store, Remote: remote, Now: func() time.Time { return now },
Grace: 30 * time.Minute, StallAfter: 2 * time.Hour, StaleAfter: 6 * time.Hour,
ConfirmConcurrency: 1, KeepRuns: 30, MaxAge: 90 * 24 * time.Hour,
WeKnoraWebBase: func(context.Context) string { return "https://test.example/" }})
if err != nil {
t.Fatal(err)
}
if err := service.ExecuteRun(context.Background(), "run-r6"); err != nil {
t.Fatal(err)
}
r6 := map[string]governance.ReconciliationFinding{}
for _, finding := range store.findings {
if finding.Type == "R6" {
r6[finding.PublicationID] = finding
}
}
if len(r6) != len(store.removal) {
t.Fatalf("R6 count = %d, removal candidates = %d; findings=%#v", len(r6), len(store.removal), store.findings)
}
if processing, ok := r6["pub-a"]; !ok || processing.WeKnoraParseState != "processing" || processing.NormalizedState != "processing" {
t.Fatalf("R6 must keep an upstream-processing row: %#v", processing)
}
if missing, ok := r6["pub-b"]; !ok || missing.DocumentID != "doc-b" {
t.Fatalf("R6 must keep a row the scan could not list: %#v", missing)
}
if store.completedRun == nil || store.completedRun.Counts["R6"] != len(store.removal) {
t.Fatalf("run counts R6 = %#v", store.completedRun)
}
}
// TestCreateRunEnqueuesJobWithinJobIDLimit freezes the queue contract: jobs.id is
// VARCHAR(36), and the run id ("rec-" + 32 hex) already fills it. Deriving the job
// id from the run id overflowed the column, so every batch was created `failed`
// with queue_unavailable before a worker ever saw it.
func TestCreateRunEnqueuesJobWithinJobIDLimit(t *testing.T) {
now := time.Date(2026, 12, 1, 12, 0, 0, 0, time.UTC)
store := &fakeReconciliationStore{
run: governance.ReconciliationRun{ID: "rec-unused", KBID: "kb-1", State: "running", Trigger: "manual", StartedAt: now},
}
service, err := New(Config{Store: store, Queue: store, Remote: &fakeReconciliationRemote{},
Now: func() time.Time { return now }, Grace: 30 * time.Minute, StallAfter: 2 * time.Hour,
StaleAfter: 6 * time.Hour, ConfirmConcurrency: 1, KeepRuns: 30, MaxAge: 90 * 24 * time.Hour,
WeKnoraWebBase: func(context.Context) string { return "https://test.example/" }})
if err != nil {
t.Fatal(err)
}
run, err := service.CreateRun(context.Background(), "kb-1", "manual")
if err != nil {
t.Fatalf("CreateRun error = %v", err)
}
if len(store.enqueued) != 1 {
t.Fatalf("enqueued %d jobs", len(store.enqueued))
}
request := store.enqueued[0]
if len(request.ID) != 36 {
t.Fatalf("job id %q length = %d, want exactly 36 (VARCHAR(36))", request.ID, len(request.ID))
}
if request.Type != "reconciliation.run" || request.IdempotencyKey != "reconciliation-run:"+run.ID {
t.Fatalf("enqueue request = %#v", request)
}
if string(request.Payload) != `{"run_id":"`+run.ID+`"}` {
t.Fatalf("payload = %s", request.Payload)
}
}
+44 -1
View File
@@ -1,6 +1,7 @@
import { renderToStaticMarkup } from 'react-dom/server' import { renderToStaticMarkup } from 'react-dom/server'
import { describe, expect, it, vi } from 'vitest' import { describe, expect, it, vi } from 'vitest'
import { FindingDetail, ReconciliationFindingsView } from './ReconciliationFindings' import { FindingDetail, ReconciliationFindingsView, ServiceStrip } from './ReconciliationFindings'
import type { MonitorOverview } from './monitor'
import type { ReconciliationFinding, ReconciliationRun } from './reconciliationApi' import type { ReconciliationFinding, ReconciliationRun } from './reconciliationApi'
const run: ReconciliationRun = { const run: ReconciliationRun = {
@@ -114,3 +115,45 @@ describe('reconciliation findings', () => {
expect(html).toContain('在 WeKnora 中打开') expect(html).toContain('在 WeKnora 中打开')
}) })
}) })
describe('ServiceStrip queue availability', () => {
const overview = (queues: MonitorOverview['weknora_queues']) =>
({ weknora_queues: queues, health: [] }) as unknown as MonitorOverview
it('states an unavailable queue instead of rendering 0 waiting · 0 active', () => {
const html = renderToStaticMarkup(
<ServiceStrip
overview={overview({ available: false, queues_error: true, workers_error: false, queues: [], timestamp: 0 })}
/>
)
expect(html).toContain('队列不可用')
expect(html).not.toContain('0 等待')
})
it('prints queue depth when the queue is available', () => {
const html = renderToStaticMarkup(
<ServiceStrip
overview={overview({
available: true,
queues_error: false,
workers_error: false,
timestamp: 0,
queues: [
{
name: 'default',
pool: 'default',
pending: 2,
active: 1,
scheduled: 0,
retry: 0,
archived: 0,
processed: 0,
failed: 0,
},
],
})}
/>
)
expect(html).toContain('2 等待 · 1 运行')
})
})
+1 -1
View File
@@ -75,7 +75,7 @@ export function ServiceStrip({ overview }: { overview: MonitorOverview | null })
<section className="monitor-service-strip" aria-label="服务与队列"> <section className="monitor-service-strip" aria-label="服务与队列">
<span> <span>
WeKnora 队列: WeKnora 队列:
{queue ? ( {queue?.available ? (
<b> <b>
{queue.queues.reduce((sum, item) => sum + item.pending, 0)} 等待 ·{' '} {queue.queues.reduce((sum, item) => sum + item.pending, 0)} 等待 ·{' '}
{queue.queues.reduce((sum, item) => sum + item.active, 0)} 运行 {queue.queues.reduce((sum, item) => sum + item.active, 0)} 运行