HomeSoftware Heritage

Return 0 slot if no more slots available in the queues

Description

Return 0 slot if no more slots available in the queues

This scenario happens with the loader oneshot for example. This loader deals with more
than 1 type of origins to ingest in the same queue. So the computation of that function
returned negative value [1]. Which is ultimately not possible to execute in sql [1].

This commits fixes that behavior. This also explicits that the function must return
positive values in its docstring.

[1]

...
psycopg2.errors.InvalidRowCountInLimitClause: LIMIT must not be negative

Details

Provenance
ardumontAuthored on Oct 15 2021, 3:14 PM
ardumontPushed on Oct 15 2021, 3:49 PM
Differential Revision
D6487: Return 0 slot if no more slots available in the queues
Parents
rDSCHecc14007aa25: runner: Improve help message on the task types flag.
Branches
Unknown
Tags
Unknown
References
tag: v0.18.1
Build Status
Buildable 24468
Build 38178: test-and-buildJenkins console · Jenkins