Skip to content

Commit 63040f8

Browse files
committed
Fix total proxy count when only untested is checked
Closes #240
1 parent ff06245 commit 63040f8

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

RuriLib/Models/Jobs/ProxyCheckJob.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,17 +260,17 @@ public override async Task Start(CancellationToken cancellationToken = default)
260260
if (SuccessKey is null)
261261
throw new NullReferenceException("The success key cannot be null");
262262

263-
var proxies = CheckOnlyUntested
263+
var proxies = (CheckOnlyUntested
264264
? Proxies.Where(p => p.WorkingStatus == ProxyWorkingStatus.Untested)
265-
: Proxies;
265+
: Proxies).ToList();
266266

267267
// Update the stats
268-
Total = proxies.Count();
268+
Total = proxies.Count;
269269
Tested = proxies.Count(p => p.WorkingStatus != ProxyWorkingStatus.Untested);
270270
Working = proxies.Count(p => p.WorkingStatus == ProxyWorkingStatus.Working);
271271
NotWorking = proxies.Count(p => p.WorkingStatus == ProxyWorkingStatus.NotWorking);
272272

273-
if (!proxies.Any())
273+
if (proxies.Count == 0)
274274
throw new Exception("No proxies provided to check");
275275

276276
Status = JobStatus.Waiting;
@@ -285,7 +285,7 @@ public override async Task Start(CancellationToken cancellationToken = default)
285285
var workItems = proxies.Select(p => new ProxyCheckInput(p, Url, SuccessKey, Timeout, GeoProvider));
286286
parallelizer = ParallelizerFactory<ProxyCheckInput, Proxy>
287287
.Create(settings.RuriLibSettings.GeneralSettings.ParallelizerType, workItems,
288-
workFunction, Bots, Proxies.Count(), 0, BotLimit);
288+
workFunction, Bots, proxies.Count, 0, BotLimit);
289289

290290
parallelizer.NewResult += UpdateProxy;
291291
parallelizer.ProgressChanged += PropagateProgress;

0 commit comments

Comments
 (0)