bugfixes after onlineveilingmeester update

This commit is contained in:
Computerboer
2023-07-09 21:19:08 +02:00
parent 96b4cdc0ea
commit 84b190edab
2 changed files with 9 additions and 7 deletions

View File

@@ -13,11 +13,11 @@ class Cache():
print('removing cacheobject ' + key)
del cache[key]
return None
#print('returning cacheobject ' + key)
print(str(datetime.now()) + ' returning cacheobject ' + key)
return cacheobj.obj
def add(key, obj):
print('adding cacheobject ' + key)
print(str(datetime.now()) + ' adding cacheobject ' + key)
cacheobj = CacheObj(key, obj)
cache[key] = cacheobj

View File

@@ -1,4 +1,3 @@
from asyncio.windows_events import NULL
import requests
from cache import Cache
from models.location import Auction, Auctionbrand, Countrycode, Maplocation
@@ -9,8 +8,8 @@ def getAuctionlocations(countrycode: Countrycode):
cachename = 'allauctions_' + countrycode
res = Cache.get(cachename)
if(res): return res
if(res):
return res
twkauctions = getTwkAuctions(countrycode)
ovmauctions = getOVMAuctions()
@@ -52,7 +51,8 @@ def get_geonameid(auction):
def getTwkAuctions(countrycode):
cachename = 'TwkAuctions_'+ countrycode
res = Cache.get(cachename)
if(res):return res
if(res):
return res
response = requests.get("https://api.troostwijkauctions.com/sale/4/listgrouped?batchSize=99999&CountryIDs=" + countrycode)
@@ -72,11 +72,13 @@ def getTwkAuctions(countrycode):
def getOVMAuctions():
cachename = 'OnlineVeiling_'
res = Cache.get(cachename)
if(res):return res
if(res):
return res
response = requests.get("https://onlineveilingmeester.nl/rest/nl/veilingen?status=open&domein=ONLINEVEILINGMEESTER")
if(response.status_code ==200):
print('Got Ovm Auctions')
data = response.json()
auctions = []
for result in data['veilingen']: