Skip to content

Commit

Permalink
fix: 修复 CachedStorage 的 WatchDog 代码错误
Browse files Browse the repository at this point in the history
  • Loading branch information
SALTWOOD committed May 26, 2024
1 parent 090cd77 commit 7b8c809
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CSharp-OpenBMCLAPI/Modules/Cluster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ await socket.EmitAsync("keep-alive",

private void _keepAliveMessageParser(SocketIOResponse resp)
{
Debugger.Break();

}

/// <summary>
Expand Down Expand Up @@ -655,6 +655,8 @@ public async Task RequestCertification()
}
string certPath = Path.Combine(ClusterRequiredData.Config.clusterWorkingDirectory, $"certifications/cert.pem");
string keyPath = Path.Combine(ClusterRequiredData.Config.clusterWorkingDirectory, $"certifications/key.pem");
string pfxPath = Path.Combine(ClusterRequiredData.Config.clusterWorkingDirectory, $"certifications/cert.pfx");
if (File.Exists(pfxPath)) File.Delete(pfxPath);
Directory.CreateDirectory(Path.Combine(ClusterRequiredData.Config.clusterWorkingDirectory, $"certifications"));
await socket.EmitAsync("request-cert", (SocketIOResponse resp) =>
{
Expand Down
4 changes: 2 additions & 2 deletions CSharp-OpenBMCLAPI/Modules/Storage/CachedStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ public void Initialize()
public void MemoryWatchdog()
{
double memory = GetCachedMemory();
if (memory > 0 && memory > ClusterRequiredData.Config.maxCachedMemory)
if (memory > 0 && memory > ClusterRequiredData.Config.maxCachedMemory * 1048576)
{
Logger.Instance.LogWarn($"缓存存储已大于 {ClusterRequiredData.Config.maxCachedMemory}(当前 {memory}),已开始清理缓存");
Logger.Instance.LogWarn($"缓存存储已大于 {ClusterRequiredData.Config.maxCachedMemory}(当前 {memory / 1048576}),已开始清理缓存");
int count = 0;
do
{
Expand Down

0 comments on commit 7b8c809

Please sign in to comment.