mirror of
https://kevinblog.sytes.net/Code/Jibo-Revival-Group/JiboExperiments.git
synced 2026-06-17 07:36:01 +00:00
Document local cloud startup and harden persistence
This commit is contained in:
@@ -8,6 +8,15 @@ This is the production-oriented path for restoring device connectivity and creat
|
||||
|
||||
Current spoken cloud version: `Cloud version 1.0.19.`
|
||||
|
||||
Local startup:
|
||||
|
||||
```powershell
|
||||
.\scripts\cloud\Start-OpenJiboDotNet.ps1
|
||||
```
|
||||
|
||||
Run that from the repo root. For the full local guide, including Node and Playground, see
|
||||
[local-cloud-quickstart.md](../../../docs/local-cloud-quickstart.md).
|
||||
|
||||
Release hygiene reminder:
|
||||
|
||||
- bump [OpenJiboCloudBuildInfo.cs](/C:/Projects/JiboExperiments/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Services/OpenJiboCloudBuildInfo.cs) whenever we ship a meaningful hosted-cloud update
|
||||
|
||||
@@ -239,4 +239,6 @@ static CloudSession ResolveSession(JiboWebSocketService webSocketService, WebSoc
|
||||
return webSocketService.GetOrCreateSession(envelope);
|
||||
}
|
||||
|
||||
internal sealed record ReceivedSocketMessage(WebSocketMessageType MessageType, byte[] Buffer);
|
||||
internal sealed record ReceivedSocketMessage(WebSocketMessageType MessageType, byte[] Buffer);
|
||||
|
||||
public partial class Program;
|
||||
|
||||
@@ -123,7 +123,7 @@ public sealed class CloudStateCommuteReportProvider(ICloudStateStore cloudStateS
|
||||
return true;
|
||||
}
|
||||
|
||||
private static string? ResolveLoopId(TurnContext turn)
|
||||
private static string ResolveLoopId(TurnContext turn)
|
||||
{
|
||||
if (turn.Attributes.TryGetValue("loopId", out var loopValue) &&
|
||||
loopValue is not null &&
|
||||
@@ -147,4 +147,4 @@ public sealed class CloudStateCommuteReportProvider(ICloudStateStore cloudStateS
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,22 @@ internal sealed class JsonFileSnapshotStore(string? persistencePath, JsonSeriali
|
||||
var directory = Path.GetDirectoryName(persistencePath);
|
||||
if (!string.IsNullOrWhiteSpace(directory)) Directory.CreateDirectory(directory);
|
||||
|
||||
File.WriteAllText(persistencePath, JsonSerializer.Serialize(snapshot, options));
|
||||
var tempPath = Path.Combine(
|
||||
string.IsNullOrWhiteSpace(directory) ? Directory.GetCurrentDirectory() : directory,
|
||||
$".{Path.GetFileName(persistencePath)}.{Guid.NewGuid():N}.tmp");
|
||||
|
||||
try
|
||||
{
|
||||
File.WriteAllText(tempPath, JsonSerializer.Serialize(snapshot, options));
|
||||
|
||||
if (File.Exists(persistencePath))
|
||||
File.Replace(tempPath, persistencePath, null);
|
||||
else
|
||||
File.Move(tempPath, persistencePath);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (File.Exists(tempPath)) File.Delete(tempPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user