Skip to content

Commit

Permalink
Merge pull request #39 from AElfProject/feature/stateless-worker-grain
Browse files Browse the repository at this point in the history
feat: limit to 10 concurrent builds per silo
  • Loading branch information
yongenaelf authored Oct 10, 2024
2 parents 2749bb1 + a7dfe47 commit 6a833e5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion PlaygroundService/Grains/PlaygroundGrain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Orleans;
using Orleans.Concurrency;
using PlaygroundService.Dtos;
using PlaygroundService.Utilities;

namespace PlaygroundService.Grains;

[StatelessWorker(10)] // max 10 activations per silo
public class PlaygroundGrain : Grain, IPlaygroundGrain
{
private readonly ILogger<PlaygroundGrain> _logger;
Expand Down Expand Up @@ -94,7 +97,7 @@ public async Task<List<string>> GetTemplates()
process.Start(); // start process
// If necessary,can read the output of the process
// string output = process.StandardOutput.ReadToEnd();
process.WaitForExit(); // Waiting for process to exit
await process.WaitForExitAsync(); // Waiting for process to exit
}
_logger.LogInformation("PlayGroundGrain GenerateZip dotnet new end command: " + command + " time: " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));

Expand Down

0 comments on commit 6a833e5

Please sign in to comment.