Skip to content

Commit 4b52cc0

Browse files
author
ma111e
committed
fix(llms): add deadline slack to pipeline timeout checks; tighten docs prose
1 parent 27795eb commit 4b52cc0

4 files changed

Lines changed: 8 additions & 7 deletions

File tree

cmd/server/internal/services/llms.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -695,10 +695,11 @@ func (s *LLMsServer) runAnalysisPipeline(ctx context.Context, req *protos.Analyz
695695
// Ensure the pipeline has at least 60 minutes total (tasks run sequentially;
696696
// each individual Stream call gets its own provider-configured sub-deadline below).
697697
const pipelineTimeout = 60 * time.Minute
698+
const deadlineSlack = 1 * time.Minute // absorb elapsed time / equal-deadline callers
698699
if deadline, ok := ctx.Deadline(); ok {
699700
remaining := time.Until(deadline)
700701
log.Infof("Context deadline: %v (remaining: %v)", deadline, remaining)
701-
if remaining < pipelineTimeout {
702+
if remaining < pipelineTimeout-deadlineSlack {
702703
log.Warnf("Context deadline shorter than preferred pipeline timeout (%v < %v); preserving caller cancellation", remaining, pipelineTimeout)
703704
}
704705
} else {
@@ -875,10 +876,11 @@ func (s *LLMsServer) AnalyzeArticleWithProgress(ctx context.Context, req *protos
875876

876877
func (s *LLMsServer) AnalyzeArticleOneShot(ctx context.Context, req *protos.AnalyzeArticleWithProviderModelRequest, onTask func(taskName, status string, taskIndex, totalTasks int, err error)) (*protos.AnalyzeArticleWithProviderModelResponse, error) {
877878
const oneShotTimeout = 60 * time.Minute
879+
const deadlineSlack = 1 * time.Minute // absorb elapsed time / equal-deadline callers
878880
if deadline, ok := ctx.Deadline(); ok {
879881
remaining := time.Until(deadline)
880882
log.Infof("Context deadline: %v (remaining: %v)", deadline, remaining)
881-
if remaining < oneShotTimeout {
883+
if remaining < oneShotTimeout-deadlineSlack {
882884
log.Warnf("Context deadline shorter than preferred one-shot timeout (%v < %v); preserving caller cancellation", remaining, oneShotTimeout)
883885
}
884886
} else {

docs/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Downlink is a feed aggregator and content-analysis platform for security news. I
44
RSS/Atom feeds, scrapes full article content, scores and summarizes each article with an
55
LLM, and assembles ranked digests it can publish to GitHub Pages and Discord.
66

7-
New here? Start with [getting-started.md](getting-started.md). The project
8-
[README](../README.md) has the high-level overview and install instructions.
7+
Start with [getting-started.md](getting-started.md). The project
8+
[README](../README.md) covers the overview and install.
99

1010
## Guides
1111

docs/getting-started.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Getting started
22

3-
This walks through a first run from a clean checkout. The project README has the same path
4-
in condensed form; this page adds the details it skips.
3+
A first run from a clean checkout: install, configure, fetch, and produce a digest.
54

65
## Install
76

docs/github-pages.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ Each entry in `digests`:
171171

172172
## 7. Discord publish notification
173173

174-
The `discord_webhook_url` field is distinct from the main `notifications.discord.webhook_url`. It is designed to post a lightweight one-line message when a page goes live:
174+
The `discord_webhook_url` field is distinct from the main `notifications.discord.webhook_url`. It posts a one-line message when a page goes live:
175175

176176
```
177177
📰 New digest published to GitHub Pages: https://you.github.io/digests/downlink-digest-2026-04-24_1200.html

0 commit comments

Comments
 (0)