Use old price information if update fails. Add "(!)" to show that price is out of date

This commit is contained in:
blitzmann
2015-07-03 02:37:52 -04:00
parent 6cc6fd9468
commit 874cf4ef0a
5 changed files with 12 additions and 16 deletions

View File

@@ -706,10 +706,6 @@ class Market():
self.priceCache[typeID] = price
if not price.isValid:
# if the price has expired
price.price = None
return price
def getPricesNow(self, typeIDs):

View File

@@ -71,7 +71,6 @@ class Price():
# Attempt to send request and process it
try:
len(priceMap)
network = service.Network.getInstance()
data = network.request(baseurl, network.PRICES, data)
xml = minidom.parse(data)
@@ -102,7 +101,7 @@ class Price():
for typeID in priceMap.keys():
priceobj = priceMap[typeID]
priceobj.time = time.time() + TIMEOUT
priceobj.failed = None
priceobj.failed = True
del priceMap[typeID]
except:
# all other errors will pass and continue onward to the REREQUEST delay
@@ -111,6 +110,5 @@ class Price():
# if we get to this point, then we've got an error. Set to REREQUEST delay
for typeID in priceMap.keys():
priceobj = priceMap[typeID]
priceobj.price = 0
priceobj.time = time.time() + REREQUEST
priceobj.failed = None
priceobj.failed = True