Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Mar 31, 2024
1 parent 7823a21 commit 86d2c30
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 1 addition & 4 deletions v2rayN/v2rayN/Handler/StatisticsSingbox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ private async void Run()

while (!_exitFlag)
{
await Task.Delay(1000);
try
{
if (!(_config.runningCoreType is ECoreType.sing_box or ECoreType.clash or ECoreType.clash_meta or ECoreType.mihomo))
Expand Down Expand Up @@ -105,10 +106,6 @@ private async void Run()
catch
{
}
finally
{
await Task.Delay(1000);
}
}
}

Expand Down
8 changes: 5 additions & 3 deletions v2rayN/v2rayN/Handler/StatisticsV2ray.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ private async void Run()
{
while (!_exitFlag)
{
await Task.Delay(1000);
try
{
if (!(_config.runningCoreType is ECoreType.Xray or ECoreType.v2fly or ECoreType.v2fly_v5 or ECoreType.SagerNet))
Expand All @@ -60,7 +61,8 @@ private async void Run()
QueryStatsResponse? res = null;
try
{
res = await _client.QueryStatsAsync(new QueryStatsRequest() { Pattern = "", Reset = true });
if (_client != null)
res = await _client.QueryStatsAsync(new QueryStatsRequest() { Pattern = "", Reset = true });
}
catch
{
Expand All @@ -72,8 +74,8 @@ private async void Run()
_updateFunc(server);
}
}
await Task.Delay(1000);
if (_channel != null) await _channel.ConnectAsync();
if (_channel != null)
await _channel.ConnectAsync();
}
catch
{
Expand Down

0 comments on commit 86d2c30

Please sign in to comment.