Do not generate empty fetches when everything has been requested

This commit is contained in:
DarkPhoenix
2019-02-21 16:50:10 +03:00
parent c66f80d6e5
commit e36b9661f0
2 changed files with 4 additions and 2 deletions

View File

@@ -37,7 +37,8 @@ class EveMarketData:
# Try selected system first
self.fetchPrices(priceMap, max(2 * fetchTimeout / 3, 2), system)
# If price was not available - try globally
self.fetchPrices(priceMap, max(fetchTimeout / 3, 2))
if priceMap:
self.fetchPrices(priceMap, max(fetchTimeout / 3, 2))
def fetchPrices(self, priceMap, fetchTimeout, system=None):
params = {"type_ids": ','.join(str(typeID) for typeID in priceMap)}

View File

@@ -37,7 +37,8 @@ class EveMarketer:
# Try selected system first
self.fetchPrices(priceMap, max(2 * fetchTimeout / 3, 2), system)
# If price was not available - try globally
self.fetchPrices(priceMap, max(fetchTimeout / 3, 2))
if priceMap:
self.fetchPrices(priceMap, max(fetchTimeout / 3, 2))
def fetchPrices(self, priceMap, fetchTimeout, system=None):
params = {"typeid": {typeID for typeID in priceMap}}