Skip to content

Commit

Permalink
Update web server (#306)
Browse files Browse the repository at this point in the history
* Set max iasyncenumerable buffer limit

* Remove format job

---------

Co-authored-by: Boris Ahrens <boris.ahrens@gdata.de>
  • Loading branch information
borisahrens and Boris Ahrens authored Feb 26, 2024
1 parent 13d5ab8 commit 1c72d7e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/dotnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,6 @@ on:
- '[0-9]+.[0-9]+.[0-9]+*'

jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: "8.0"
- name: check format
run: dotnet format --severity error --verify-no-changes ./MalwareSampleExchange.sln

build:
runs-on: ubuntu-latest
steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
using Microsoft.Extensions.Options;
using MalwareSampleExchange.Console.Attributes;
using MalwareSampleExchange.Console.Models;
using Microsoft.IdentityModel.Tokens;
using MalwareSampleExchange.Console.ListRequester;
using MalwareSampleExchange.Console.SampleStorage;
using Prometheus.Client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public Task<IActionResult> ListTokens([FromQuery][Required] DateTime start, [Fro

var tokens = _listRequester
.RequestList(username, start, end, token)
.CountAndCallAsync(count => _listRequestHistogram.WithLabels(username).Set(count)); ;
.CountAndCallAsync(count => _listRequestHistogram.WithLabels(username).Set(count));
return Task.FromResult<IActionResult>(Ok(tokens));
}
catch (Exception e)
Expand Down
6 changes: 5 additions & 1 deletion src/MalwareSampleExchange.Console/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ public void ConfigureServices(IServiceCollection services)
services.Configure<UploadOptions>(_configuration.GetSection("Upload"));

services
.AddMvc(options => options.EnableEndpointRouting = false)
.AddMvc(options =>
{
options.EnableEndpointRouting = false;
options.MaxIAsyncEnumerableBufferLimit = int.MaxValue;
})
.AddNewtonsoftJson(opts =>
{
opts.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
Expand Down

0 comments on commit 1c72d7e

Please sign in to comment.