Pin nixpkgs to the revision used by itc.componentware: the channel version ships a latexminted that crashes on Python 3.14, which made every listing fail and sent latexmk into an endless error prompt. Also force nonstopmode/halt-on-error so a broken listing can never loop again.
29 lines
1021 B
C#
29 lines
1021 B
C#
private async IAsyncEnumerable<ListObjectsV2Response> EnumerateResponsesAsync(
|
|
Func<ListObjectsV2Request> requestBuilder,
|
|
[EnumeratorCancellation] CancellationToken cancellationToken)
|
|
{
|
|
string? continuationToken = null;
|
|
do
|
|
{
|
|
var request = requestBuilder();
|
|
request.ContinuationToken = continuationToken;
|
|
request.BucketName = _settings.S3.Bucket;
|
|
|
|
var response = await s3.ListObjectsV2Async(request, cancellationToken);
|
|
yield return response;
|
|
|
|
continuationToken = response.IsTruncated == true ? response.NextContinuationToken : null;
|
|
} while (continuationToken is not null);
|
|
}
|
|
|
|
private async IAsyncEnumerable<S3Object> EnumerateObjectsAsync(
|
|
Func<ListObjectsV2Request> requestBuilder,
|
|
[EnumeratorCancellation] CancellationToken cancellationToken)
|
|
{
|
|
await foreach (var response in EnumerateResponsesAsync(requestBuilder, cancellationToken))
|
|
{
|
|
foreach (var obj in response.S3Objects ?? [])
|
|
yield return obj;
|
|
}
|
|
}
|