Cap sync_interval at 30 days
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful

This commit is contained in:
2026-10-25 19:15:19 +11:00
parent ee55ef3fcd
commit 7336df8a0e
3 changed files with 12 additions and 5 deletions
+3 -1
View File
@@ -57,7 +57,7 @@ func TestMutableTTLOmittedVsZero(t *testing.T) {
}
// sync_interval round-trips through the API and DB on github_* remotes and is
// rejected when negative or on a type without a background syncer.
// rejected when negative, over the maximum, or on a type without a background syncer.
func TestSyncIntervalAPI(t *testing.T) {
if testDSN == "" {
t.Skip("Docker unavailable")
@@ -93,6 +93,8 @@ func TestSyncIntervalAPI(t *testing.T) {
for _, body := range []string{
`{"name":"si-neg",` + gh + `,"sync_interval":-1}`,
`{"name":"si-max",` + gh + `,"sync_interval":2592001}`,
`{"name":"si-int32",` + gh + `,"sync_interval":2147483648}`,
`{"name":"si-rpm","package_type":"rpm","base_url":"https://example.com/repo","sync_interval":60}`,
} {
if c := do(t, h, "POST", "/", body); c != 400 {