Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/update-cronus'
Browse files Browse the repository at this point in the history
  • Loading branch information
mynkow committed Jan 25, 2024
2 parents aa3e961 + 776e25b commit f5c4ef8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/Elders.Cronus.Api/Controllers/ProjectionRebuildController.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using Elders.Cronus.EventStore.Players;
using System;
using System.ComponentModel.DataAnnotations;
using Elders.Cronus.EventStore.Players;
using Elders.Cronus.MessageProcessing;
using Elders.Cronus.Projections.Versioning;
using Microsoft.AspNetCore.Mvc;
using System;
using System.ComponentModel.DataAnnotations;

namespace Elders.Cronus.Api.Controllers
{
Expand Down Expand Up @@ -35,12 +35,12 @@ public IActionResult Rebuild([FromBody] RequestModel model)
if (model.PlayerOptions.MaxDegreeOfParallelism.HasValue && model.PlayerOptions.MaxDegreeOfParallelism.Value > 0 && model.PlayerOptions.MaxDegreeOfParallelism.Value < 100)
replayEventsOptions.MaxDegreeOfParallelism = model.PlayerOptions.MaxDegreeOfParallelism.Value;

var command = new RebuildProjectionCommand(new ProjectionVersionManagerId(model.ProjectionContractId, contextAccessor.CronusContext.Tenant), model.Hash, replayEventsOptions);
var command = new FixProjectionVersion(new ProjectionVersionManagerId(model.ProjectionContractId, contextAccessor.CronusContext.Tenant), model.Hash, replayEventsOptions);

if (_publisher.Publish(command))
return new OkObjectResult(new ResponseResult());

return new BadRequestObjectResult(new ResponseResult<string>($"Unable to publish command '{nameof(ReplayProjection)}'"));
return new BadRequestObjectResult(new ResponseResult<string>($"Unable to publish command '{nameof(FixProjectionVersion)}'"));
}

[HttpPost, Route("Replay")]
Expand All @@ -57,12 +57,12 @@ public IActionResult Replay([FromBody] RequestModel model)
if (model.PlayerOptions.MaxDegreeOfParallelism.HasValue && model.PlayerOptions.MaxDegreeOfParallelism.Value > 0 && model.PlayerOptions.MaxDegreeOfParallelism.Value < 100)
replayEventsOptions.MaxDegreeOfParallelism = model.PlayerOptions.MaxDegreeOfParallelism.Value;

var command = new ReplayProjection(new ProjectionVersionManagerId(model.ProjectionContractId, contextAccessor.CronusContext.Tenant), model.Hash, replayEventsOptions);
var command = new NewProjectionVersion(new ProjectionVersionManagerId(model.ProjectionContractId, contextAccessor.CronusContext.Tenant), model.Hash, replayEventsOptions);

if (_publisher.Publish(command))
return new OkObjectResult(new ResponseResult());

return new BadRequestObjectResult(new ResponseResult<string>($"Unable to publish command '{nameof(RebuildProjectionCommand)}'"));
return new BadRequestObjectResult(new ResponseResult<string>($"Unable to publish command '{nameof(NewProjectionVersion)}'"));
}

public class RequestModel
Expand Down
2 changes: 1 addition & 1 deletion src/Elders.Cronus.Api/Elders.Cronus.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Cronus" Version="10.2.0" />
<PackageReference Include="Cronus" Version="10.3.4" />
<PackageReference Include="Cronus.AspNetCore" Version="10.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.1" />
Expand Down

0 comments on commit f5c4ef8

Please sign in to comment.