fix: a cancelled or timed-out crawl stores what it fetched and ends

The crawl job's context ends on a cancel or at the job timeout. Storing
the pages, links and issues now runs on a context detached from it with
its own 10-minute bound, a timeout ends the crawl failed with a
time-limit error, a LoadLimits failure falls back to the defaults, and a
fetch cut short by the cancellation is recorded as canceled.
This commit is contained in:
Jakub Zych
2026-11-04 22:50:22 +01:00
parent 9de6b2ec83
commit d7597bb1a5
5 changed files with 234 additions and 17 deletions

View File

@@ -2,7 +2,6 @@ package seo
import (
"context"
"time"
"git.golem15.com/golem15/sm-seo-plugin/classes"
"git.golem15.com/golem15/sm-seo-plugin/classes/crawl"
@@ -16,7 +15,7 @@ import (
func (p *Plugin) Jobs() []pact.Job {
return []pact.Job{
conga.Job(p.generateEntries, conga.MaxAttempts(3)),
conga.Job(p.crawl, conga.MaxAttempts(1), conga.Timeout(6*time.Hour)),
conga.Job(p.crawl, conga.MaxAttempts(1), conga.Timeout(crawl.JobTimeout)),
}
}