feat(site): route RefreshDeploymentCommand to deployment-manager proxy
This commit is contained in:
@@ -97,6 +97,11 @@ public class SiteCommunicationActor : ReceiveActor, IWithTimers
|
|||||||
_log.Debug("Routing DeployInstanceCommand for {0} to DeploymentManager", msg.InstanceUniqueName);
|
_log.Debug("Routing DeployInstanceCommand for {0} to DeploymentManager", msg.InstanceUniqueName);
|
||||||
_deploymentManagerProxy.Forward(msg);
|
_deploymentManagerProxy.Forward(msg);
|
||||||
});
|
});
|
||||||
|
Receive<RefreshDeploymentCommand>(msg =>
|
||||||
|
{
|
||||||
|
_log.Debug("Routing RefreshDeploymentCommand for {0} to DeploymentManager", msg.InstanceUniqueName);
|
||||||
|
_deploymentManagerProxy.Forward(msg);
|
||||||
|
});
|
||||||
|
|
||||||
// Pattern 2: Lifecycle — forward to Deployment Manager
|
// Pattern 2: Lifecycle — forward to Deployment Manager
|
||||||
Receive<DisableInstanceCommand>(msg => _deploymentManagerProxy.Forward(msg));
|
Receive<DisableInstanceCommand>(msg => _deploymentManagerProxy.Forward(msg));
|
||||||
|
|||||||
@@ -39,6 +39,21 @@ public class SiteCommunicationActorTests : TestKit
|
|||||||
dmProbe.ExpectMsg<DeployInstanceCommand>(msg => msg.DeploymentId == "dep1");
|
dmProbe.ExpectMsg<DeployInstanceCommand>(msg => msg.DeploymentId == "dep1");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void RefreshDeploymentCommand_ForwardedToDeploymentManager()
|
||||||
|
{
|
||||||
|
var dmProbe = CreateTestProbe();
|
||||||
|
var siteActor = Sys.ActorOf(Props.Create(() =>
|
||||||
|
new SiteCommunicationActor("site1", _options, dmProbe.Ref)));
|
||||||
|
|
||||||
|
var command = new RefreshDeploymentCommand(
|
||||||
|
"dep1", "inst1", "hash1", "admin", DateTimeOffset.UtcNow,
|
||||||
|
"https://central/", "tok1");
|
||||||
|
siteActor.Tell(command);
|
||||||
|
|
||||||
|
dmProbe.ExpectMsg<RefreshDeploymentCommand>(msg => msg.DeploymentId == "dep1");
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void LifecycleCommands_ForwardedToDeploymentManager()
|
public void LifecycleCommands_ForwardedToDeploymentManager()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user