test staging

This commit is contained in:
Noe 2023-11-27 10:34:33 +01:00
parent bdad83995d
commit 05d7f91ec5
3 changed files with 8 additions and 5 deletions

View File

@ -72,6 +72,7 @@ public static class WebsocketManager
lock (InstallationConnections){ lock (InstallationConnections){
foreach (var installationConnection in InstallationConnections){ foreach (var installationConnection in InstallationConnections){
if ((DateTime.Now - installationConnection.Value.Timestamp) > TimeSpan.FromMinutes(1)){ if ((DateTime.Now - installationConnection.Value.Timestamp) > TimeSpan.FromMinutes(1)){
Console.WriteLine("Installation "+installationConnection.Key+" is offline, latest timestamp was "+installationConnection.Value.Timestamp);
installationConnection.Value.Status = -1; installationConnection.Value.Status = -1;
if (installationConnection.Value.Connections.Count > 0){InformWebsocketsForInstallation(installationConnection.Key);} if (installationConnection.Value.Connections.Count > 0){InformWebsocketsForInstallation(installationConnection.Key);}
} }

View File

@ -281,8 +281,9 @@ internal static class Program
if (s3Bucket != null) if (s3Bucket != null)
InformMiddleware(s3Bucket, currentSalimaxState); InformMiddleware(s3Bucket, currentSalimaxState);
} }
else if (_subscribedToQueue && _heartBitInterval==15) else if (_subscribedToQueue && _heartBitInterval>=15)
{ {
Console.WriteLine("----------------------------------------Sending Heartbit----------------------------------------");
_heartBitInterval = 0; _heartBitInterval = 0;
currentSalimaxState.Type = MessageType.Heartbit; currentSalimaxState.Type = MessageType.Heartbit;
@ -357,6 +358,7 @@ internal static class Program
private static void InformMiddleware(String? bucket, StatusMessage status) private static void InformMiddleware(String? bucket, StatusMessage status)
{ {
//ddddddddd
int.TryParse(bucket[0].ToString(), out var installationId); int.TryParse(bucket[0].ToString(), out var installationId);
var message = JsonSerializer.Serialize(status); var message = JsonSerializer.Serialize(status);

View File

@ -51,16 +51,16 @@ function InstallationTabs() {
if (installations.length === 1) { if (installations.length === 1) {
if (!currentTab) { if (!currentTab) {
navigate(`?installation=${installationId}&tab=live`, { navigate(`?installation=${installations[0].id}&tab=live`, {
replace: true replace: true
}); });
setCurrentTab('live'); setCurrentTab('live');
} else { } else {
navigate(`?installation=${installationId}&tab=${currentTab}`, { navigate(`?installation=${installations[0].id}&tab=${currentTab}`, {
replace: true replace: true
}); });
} }
} else { } else if (installations.length > 1) {
if ( if (
location.pathname === '/installations' || location.pathname === '/installations' ||
location.pathname === '/installations/' location.pathname === '/installations/'
@ -339,7 +339,7 @@ function InstallationTabs() {
> >
<Routes> <Routes>
<Route <Route
path={routes.list + '*'} path={'*'}
element={ element={
<Grid item xs={12}> <Grid item xs={12}>
<Box p={4}> <Box p={4}>