Commit 951e863
Kelvin Luck
feat: Introduce an optional escape hatch for
There are cases where we might want to page through the list of objects available
on S3 but we don't need to keep going once we've found what we are looking for.
This commit updates `listAllObjects` to accept an `until` argument - if this
is provided then when a new page of results is loaded we check if `some` of them
match the `until` - if so we don't bother loading another page.
A concrete use-case for this is in #120 - sometimes we just want to
find the currently active revision so we only need to loop through the "pages"
on S3 until we do.listAllObjects
1 parent 0b63c6f commit 951e863
1 file changed
+7
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
| 177 | + | |
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
191 | 189 | | |
192 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
193 | 194 | | |
194 | 195 | | |
195 | 196 | | |
| |||
0 commit comments