Improve logging

Skip item if 7 day price is 0
This commit is contained in:
Chomp 2021-10-16 18:57:06 +01:00
parent fa6104a453
commit 6f0b58a3fb

View File

@ -45,11 +45,21 @@ namespace MarketPriceLookup.Common.Helpers
//string currency = GetCurrencyType(fields[7]);
string bsgId = fields[8];
if (avg7daysPrice == 0)
{
LoggingHelpers.LogError($"unable to add bad item with price average of 0, ignoring: {bsgId} {name}");
continue;
}
if (priceFile.ContainsKey(bsgId))
{
//oh no
var existingItem = priceFile[bsgId];
LoggingHelpers.LogError($"Item already exists: {bsgId} {name}. item that already exists: {existingItem.TemplateId} {existingItem.Name}");
LoggingHelpers.LogError($"Unable to add item: {bsgId} {name}. existing item: {existingItem.TemplateId} {existingItem.Name}");
if (existingItem.Average7DaysPrice != avg7daysPrice)
{
LoggingHelpers.LogError($"Price diff found: already existing item price: {existingItem.Average7DaysPrice} new item price: {avg7daysPrice}");
}
}
else
{