Skip to content

Commit 5bd105f

Browse files
committed
fix endless loop when generating fastly invalidations
1 parent 5d4e8d2 commit 5bd105f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/cdn/fastly.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,13 @@ where
4646
// SurrogateKeys::from_iter::until_full only consumes as many elements as will fit into
4747
// the header.
4848
// The rest is up to the next `batching` iteration.
49-
Some(SurrogateKeys::from_iter_until_full(
50-
it.take(MAX_SURROGATE_KEYS_IN_BATCH_PURGE),
51-
))
49+
let keys = SurrogateKeys::from_iter_until_full(it.take(MAX_SURROGATE_KEYS_IN_BATCH_PURGE));
50+
51+
if keys.key_count() > 0 {
52+
Some(keys)
53+
} else {
54+
None
55+
}
5256
}) {
5357
for sid in config
5458
.fastly_service_sid_web

0 commit comments

Comments
 (0)