Adding a lot of heartbeating and OOBE work
This commit is contained in:
@@ -62,7 +62,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="etcsystemd\swarmops-frontend.service" />
|
||||
<None Include="libsystemd\swarmops-frontend.service" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -21,6 +21,17 @@ namespace Swarmops.Frontend.Socket
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
// Are we running yet?
|
||||
|
||||
if (!SystemSettings.DatabaseInitialized)
|
||||
{
|
||||
// will restart the service every 30s until db initialized on OOBE
|
||||
// also, the read of DatabaseInitialized can and will fail if
|
||||
// we're not initalized enough to even have a database
|
||||
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
|
||||
// Check if we're Sandbox
|
||||
|
||||
if (PilotInstallationIds.IsPilot(PilotInstallationIds.DevelopmentSandbox))
|
||||
@@ -163,6 +174,8 @@ namespace Swarmops.Frontend.Socket
|
||||
|
||||
private static void OnEveryTenSeconds()
|
||||
{
|
||||
SystemSettings.HeartbeatFrontend = DateTime.UtcNow.ToUnix();
|
||||
|
||||
_socketServer.WebSocketServices.Broadcast ("{\"messageType\":\"Heartbeat\"}");
|
||||
|
||||
if (_isSandbox)
|
||||
|
||||
@@ -6,7 +6,8 @@ After=network.target
|
||||
User=root
|
||||
ExecStart=/usr/bin/mono /usr/share/swarmops/frontend/bin/Swarmops.Frontend.Socket.exe
|
||||
WorkingDirectory=/usr/share/swarmops/frontend
|
||||
Restart=on-abort
|
||||
Restart=on-failure
|
||||
RestartSec=30
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
Reference in New Issue
Block a user