mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-24 16:02:50 +08:00

* updated packages but build wont work * #245 implementing more stable rafty * #245 OK so these raft integration tests are passing everytime on my local mac now...lets see about the build servergit log * #245 added donation button * #245 removed file we dont need
27 lines
761 B
C#
27 lines
761 B
C#
using System.Threading.Tasks;
|
|
using Ocelot.Configuration.Setter;
|
|
using Rafty.FiniteStateMachine;
|
|
using Rafty.Log;
|
|
|
|
namespace Ocelot.Raft
|
|
{
|
|
[ExcludeFromCoverage]
|
|
public class OcelotFiniteStateMachine : IFiniteStateMachine
|
|
{
|
|
private readonly IFileConfigurationSetter _setter;
|
|
|
|
public OcelotFiniteStateMachine(IFileConfigurationSetter setter)
|
|
{
|
|
_setter = setter;
|
|
}
|
|
|
|
public async Task Handle(LogEntry log)
|
|
{
|
|
//todo - handle an error
|
|
//hack it to just cast as at the moment we know this is the only command :P
|
|
var hack = (UpdateFileConfiguration)log.CommandData;
|
|
await _setter.Set(hack.Configuration);
|
|
}
|
|
}
|
|
}
|