Plumb ctx through classifier and Ollama HTTP path
OllamaClient.Generate/GenerateText/call now take ctx and build the HTTP request via NewRequestWithContext, so an in-flight LLM call is aborted when the parent context is cancelled (Ctrl-C). Classifier.Classify and its tier helpers take ctx too. ProcessFunc gets a ctx parameter so the poller can forward its cancellable context down to classification. Explainer.summarize manages its own 60s context since reaction-driven flow has no parent ctx to inherit.
This commit is contained in:
4
main.go
4
main.go
@@ -95,8 +95,8 @@ func main() {
|
||||
slog.Info("post queue started")
|
||||
|
||||
// Build the pipeline callback: classify → enqueue
|
||||
processItem := func(item *ingestion.FeedItem) {
|
||||
result, err := cls.Classify(item)
|
||||
processItem := func(ctx context.Context, item *ingestion.FeedItem) {
|
||||
result, err := cls.Classify(ctx, item)
|
||||
if err != nil {
|
||||
slog.Error("classification failed, will retry next cycle",
|
||||
"guid", item.GUID,
|
||||
|
||||
Reference in New Issue
Block a user