Skip to content

Commit

Permalink
fix: incorrect container count
Browse files Browse the repository at this point in the history
  • Loading branch information
GZTimeWalker committed May 21, 2023
1 parent 42cb2cc commit d90e0da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/GZCTF/CTFServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<ItemGroup>
<PackageReference Include="Docker.DotNet" Version="3.125.15" />
<PackageReference Include="KubernetesClient" Version="11.0.9" />
<PackageReference Include="KubernetesClient" Version="11.0.21" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="7.0.5" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.Json" Version="7.0.5" />
<PackageReference Include="Microsoft.AspNetCore.SpaProxy" Version="7.0.5" />
Expand Down
3 changes: 1 addition & 2 deletions src/GZCTF/Repositories/InstanceRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ public async Task<TaskResult<Container>> CreateContainer(Instance instance, Team
}

if (await context.Instances.CountAsync(i => i.Participation == instance.Participation
&& i.Container != null
&& i.Container.Status == ContainerStatus.Running, token) >= containerLimit)
&& i.Container != null, token) >= containerLimit)
return new TaskResult<Container>(TaskStatus.Denied);

if (instance.Container is null)
Expand Down

0 comments on commit d90e0da

Please sign in to comment.