This commit is contained in:
JustArchi
2016-04-26 18:01:19 +02:00
parent d1a6613541
commit 344c2ad23d
2 changed files with 6 additions and 14 deletions

View File

@@ -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";

View File

@@ -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);