Keep the recurring SCUM database poll bounded

Each dispatched poll is a durable job with two job log streams, so an
unbounded poll history would grow the platform store by roughly two
thousand jobs a day per server. A new poll now retires older terminal jobs
of the same template together with their job log streams, leaving at most
two rows per template while nothing is in flight.
This commit is contained in:
npc0-hue
2026-09-16 18:08:18 +08:00
parent 300390dc4d
commit 6985f77963
3 changed files with 120 additions and 1 deletions
+2
View File
@@ -71,6 +71,7 @@ type JobRepository interface {
GetByIdempotency(runEndpointID string, idempotencyKey string) (domain.Job, error)
List(domain.JobFilter) ([]domain.Job, error)
Update(domain.Job) error
Delete(id string) error
}
type ArtifactRepository interface {
@@ -120,6 +121,7 @@ type LogStreamRepository interface {
Get(id string) (domain.LogStream, error)
List(domain.LogStreamFilter) ([]domain.LogStream, error)
Update(domain.LogStream) error
Delete(id string) error
}
type MetricSampleRepository interface {