Skip to content

Commit e8ef65d

Browse files
committed
Allows processing of empty chain addresses so roles can be cleaned up
1 parent abdc7a0 commit e8ef65d

File tree

3 files changed

+1
-19
lines changed

3 files changed

+1
-19
lines changed

Framework/DiscordRewards/EventsAndErrors.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,5 @@ public bool HasAny()
3030
{
3131
return Hosts.Length > 0 || Clients.Length > 0;
3232
}
33-
34-
public override string ToString()
35-
{
36-
return "Hosts:" + string.Join(",", Hosts) + "Clients:" + string.Join(",", Clients);
37-
}
3833
}
3934
}

Tools/BiblioTech/Rewards/ChainActivityHandler.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ public ChainActivityHandler(ILog log, UserRepo repo)
1818

1919
public async Task ProcessChainActivity(ActiveChainAddresses activeChainAddresses)
2020
{
21-
if (!activeChainAddresses.HasAny()) return;
2221
var activeUserIds = ConvertToUserIds(activeChainAddresses);
23-
if (!activeUserIds.HasAny()) return;
2422
if (!HasChanged(activeUserIds)) return;
2523

2624
await GiveAndRemoveRoles(activeUserIds);
@@ -131,16 +129,6 @@ public ActiveUserIds(IEnumerable<ulong> hosts, IEnumerable<ulong> clients)
131129

132130
public List<ulong> Hosts { get; }
133131
public List<ulong> Clients { get; }
134-
135-
public bool HasAny()
136-
{
137-
return Hosts.Any() || Clients.Any();
138-
}
139-
140-
public override string ToString()
141-
{
142-
return "Hosts:" + string.Join(",", Hosts) + "Clients:" + string.Join(",", Clients);
143-
}
144132
}
145133
}
146134
}

Tools/TestNetRewarder/Processor.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ public async Task<TimeSegmentResponse> OnNewSegment(TimeRange timeRange)
4747
var numberOfChainEvents = await ProcessEvents(timeRange);
4848
var duration = sw.Elapsed;
4949

50-
if (numberOfChainEvents == 0) return TimeSegmentResponse.Underload;
51-
if (numberOfChainEvents > 10) return TimeSegmentResponse.Overload;
50+
if (duration > TimeSpan.FromSeconds(1)) return TimeSegmentResponse.Underload;
5251
if (duration > TimeSpan.FromSeconds(3)) return TimeSegmentResponse.Overload;
5352
return TimeSegmentResponse.OK;
5453
}

0 commit comments

Comments
 (0)