diff --git a/azure-pipelines/templates/stages/build.yml b/azure-pipelines/templates/stages/build.yml index 2269f8cf..d5aaf816 100644 --- a/azure-pipelines/templates/stages/build.yml +++ b/azure-pipelines/templates/stages/build.yml @@ -37,7 +37,7 @@ stages: scriptFolder: 'linux' osx-x64: - vmImage: macos-11 + vmImage: macos-latest target: osx-x64 scriptFolder: 'macos' diff --git a/azure-pipelines/templates/stages/test.yml b/azure-pipelines/templates/stages/test.yml index 704bdecc..f9791a67 100644 --- a/azure-pipelines/templates/stages/test.yml +++ b/azure-pipelines/templates/stages/test.yml @@ -49,7 +49,7 @@ stages: - job: TestMacOS pool: - vmImage: macos-11 + vmImage: macos-latest steps: - template: ../restore.yml diff --git a/src/fiskaltrust.Launcher/Extensions/WebApplicationExtensions.cs b/src/fiskaltrust.Launcher/Extensions/WebApplicationExtensions.cs index c3a09e70..03c267c3 100644 --- a/src/fiskaltrust.Launcher/Extensions/WebApplicationExtensions.cs +++ b/src/fiskaltrust.Launcher/Extensions/WebApplicationExtensions.cs @@ -25,10 +25,12 @@ public static WebApplication AddQueueEndpoints(this WebApplication app, IPOS pos app.MapMultiplePrefixed(_prefixesV1, "Echo", EndpointRouteBuilderExtensions.MapPost, async (ifPOS.v1.EchoRequest req) => await pos.EchoAsync(req)); app.MapMultiplePrefixed(_prefixesV0, "Echo", EndpointRouteBuilderExtensions.MapPost, async ([FromBody] string message) => (await pos.EchoAsync(new ifPOS.v1.EchoRequest { Message = message })).Message); app.MapMultiplePrefixed(_prefixes, "Sign", EndpointRouteBuilderExtensions.MapPost, async (ReceiptRequest req) => await pos.SignAsync(req)); - app.MapMultiplePrefixed(_prefixes, "Journal", EndpointRouteBuilderExtensions.MapPost, ([FromQuery] long type, [FromQuery] long? from, [FromQuery] long? to) => + app.MapMultiplePrefixed(_prefixes, "Journal", EndpointRouteBuilderExtensions.MapPost, async ([FromQuery] long type, [FromQuery] long? from, [FromQuery] long? to) => { var pipe = new Pipe(); var journal = pos.JournalAsync(new JournalRequest { ftJournalType = type, From = from ?? 0, To = to ?? 0 }); + // Throws if something failed in the request. Does not pop the first element + await journal.FirstAsync(); var _ = Task.Run(async () => { await journal.ForEachAwaitAsync(async b => await pipe.Writer.WriteAsync(new ReadOnlyMemory(b.Chunk.ToArray())));