aaaaaaaaaaaaaaaaaaaaaaa
This commit is contained in:
@@ -72,6 +72,7 @@ class Spritpreise(DbEntity):
|
||||
|
||||
def getPrices(self, fuelType):
|
||||
page = 1
|
||||
errorCount = 0
|
||||
while True:
|
||||
try:
|
||||
print(f"fuelType: {fuelType} page: {page}")
|
||||
@@ -100,6 +101,11 @@ class Spritpreise(DbEntity):
|
||||
self.fuelInfos[entryName][str(self.convertType(fuelType))] = price if price.replace(".", "").isnumeric() else None
|
||||
page += 1
|
||||
except Exception as e:
|
||||
errorCount += 1
|
||||
if errorCount > 10:
|
||||
self.__writeLog(f"To many errors occurred")
|
||||
return
|
||||
|
||||
self.__writeLog(f"Error occurred: {e}")
|
||||
time.sleep(5)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user