mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 14:10:53 +00:00
Misc
This commit is contained in:
@@ -133,16 +133,12 @@ namespace ArchiSteamFarm {
|
||||
return;
|
||||
}
|
||||
|
||||
bool alreadyExists;
|
||||
lock (Bots) {
|
||||
alreadyExists = Bots.ContainsKey(botName);
|
||||
if (!alreadyExists) {
|
||||
Bots[botName] = this;
|
||||
if (Bots.ContainsKey(botName)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (alreadyExists) {
|
||||
return;
|
||||
Bots[botName] = this;
|
||||
}
|
||||
|
||||
SentryFile = botPath + ".bin";
|
||||
|
||||
@@ -57,16 +57,12 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
internal async Task CheckTrades() {
|
||||
bool shouldRun = false;
|
||||
lock (TradesSemaphore) {
|
||||
if (ParsingTasks < 2) {
|
||||
ParsingTasks++;
|
||||
shouldRun = true;
|
||||
if (ParsingTasks >= 2) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!shouldRun) {
|
||||
return;
|
||||
ParsingTasks++;
|
||||
}
|
||||
|
||||
await TradesSemaphore.WaitAsync().ConfigureAwait(false);
|
||||
|
||||
Reference in New Issue
Block a user