mirror of
https://github.com/logos-storage/logos-storage-nim-cs-dist-tests.git
synced 2026-01-03 22:13:10 +00:00
Allows processing of empty chain addresses so roles can be cleaned up
This commit is contained in:
parent
abdc7a0ab1
commit
e8ef65d641
@ -30,10 +30,5 @@
|
||||
{
|
||||
return Hosts.Length > 0 || Clients.Length > 0;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "Hosts:" + string.Join(",", Hosts) + "Clients:" + string.Join(",", Clients);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,9 +18,7 @@ namespace BiblioTech.Rewards
|
||||
|
||||
public async Task ProcessChainActivity(ActiveChainAddresses activeChainAddresses)
|
||||
{
|
||||
if (!activeChainAddresses.HasAny()) return;
|
||||
var activeUserIds = ConvertToUserIds(activeChainAddresses);
|
||||
if (!activeUserIds.HasAny()) return;
|
||||
if (!HasChanged(activeUserIds)) return;
|
||||
|
||||
await GiveAndRemoveRoles(activeUserIds);
|
||||
@ -131,16 +129,6 @@ namespace BiblioTech.Rewards
|
||||
|
||||
public List<ulong> Hosts { get; }
|
||||
public List<ulong> Clients { get; }
|
||||
|
||||
public bool HasAny()
|
||||
{
|
||||
return Hosts.Any() || Clients.Any();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "Hosts:" + string.Join(",", Hosts) + "Clients:" + string.Join(",", Clients);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,8 +47,7 @@ namespace TestNetRewarder
|
||||
var numberOfChainEvents = await ProcessEvents(timeRange);
|
||||
var duration = sw.Elapsed;
|
||||
|
||||
if (numberOfChainEvents == 0) return TimeSegmentResponse.Underload;
|
||||
if (numberOfChainEvents > 10) return TimeSegmentResponse.Overload;
|
||||
if (duration > TimeSpan.FromSeconds(1)) return TimeSegmentResponse.Underload;
|
||||
if (duration > TimeSpan.FromSeconds(3)) return TimeSegmentResponse.Overload;
|
||||
return TimeSegmentResponse.OK;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user