Switch if to while and resolve inverted for looping issue
This commit is contained in:
parent
8ff36c6709
commit
5e9a6bf329
1 changed files with 7 additions and 7 deletions
|
|
@ -234,10 +234,10 @@ namespace TShockAPI
|
||||||
level, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture),
|
level, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture),
|
||||||
caller, message);
|
caller, message);
|
||||||
|
|
||||||
if (_failures.Count > 0)
|
|
||||||
{
|
|
||||||
var info = _failures.Last();
|
|
||||||
var success = true;
|
var success = true;
|
||||||
|
while (_failures.Count > 0 && success)
|
||||||
|
{
|
||||||
|
var info = _failures.First();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -257,7 +257,7 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
|
|
||||||
if (success)
|
if (success)
|
||||||
_failures.RemoveAt(_failures.Count - 1);
|
_failures.RemoveAt(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|
@ -278,9 +278,9 @@ namespace TShockAPI
|
||||||
_useTextLog = true;
|
_useTextLog = true;
|
||||||
_backupLog.ConsoleError("SQL Logging disabled due to errors. Reverting to text logging.");
|
_backupLog.ConsoleError("SQL Logging disabled due to errors. Reverting to text logging.");
|
||||||
|
|
||||||
for (var i = _failures.Count - 1; i >= 0; --i)
|
foreach(var logInfo in _failures)
|
||||||
{
|
{
|
||||||
_backupLog.Write(String.Format("SQL log failed at: {0}. {1}", _failures[i].timestamp, _failures[i]),
|
_backupLog.Write(String.Format("SQL log failed at: {0}. {1}", logInfo.timestamp, logInfo),
|
||||||
LogLevel.Error);
|
LogLevel.Error);
|
||||||
}
|
}
|
||||||
_failures.Clear();
|
_failures.Clear();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue