bugfixes after onlineveilingmeester update
This commit is contained in:
4
cache.py
4
cache.py
@@ -13,11 +13,11 @@ class Cache():
|
|||||||
print('removing cacheobject ' + key)
|
print('removing cacheobject ' + key)
|
||||||
del cache[key]
|
del cache[key]
|
||||||
return None
|
return None
|
||||||
#print('returning cacheobject ' + key)
|
print(str(datetime.now()) + ' returning cacheobject ' + key)
|
||||||
return cacheobj.obj
|
return cacheobj.obj
|
||||||
|
|
||||||
def add(key, obj):
|
def add(key, obj):
|
||||||
print('adding cacheobject ' + key)
|
print(str(datetime.now()) + ' adding cacheobject ' + key)
|
||||||
cacheobj = CacheObj(key, obj)
|
cacheobj = CacheObj(key, obj)
|
||||||
cache[key] = cacheobj
|
cache[key] = cacheobj
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
from asyncio.windows_events import NULL
|
|
||||||
import requests
|
import requests
|
||||||
from cache import Cache
|
from cache import Cache
|
||||||
from models.location import Auction, Auctionbrand, Countrycode, Maplocation
|
from models.location import Auction, Auctionbrand, Countrycode, Maplocation
|
||||||
@@ -9,8 +8,8 @@ def getAuctionlocations(countrycode: Countrycode):
|
|||||||
cachename = 'allauctions_' + countrycode
|
cachename = 'allauctions_' + countrycode
|
||||||
|
|
||||||
res = Cache.get(cachename)
|
res = Cache.get(cachename)
|
||||||
if(res): return res
|
if(res):
|
||||||
|
return res
|
||||||
|
|
||||||
twkauctions = getTwkAuctions(countrycode)
|
twkauctions = getTwkAuctions(countrycode)
|
||||||
ovmauctions = getOVMAuctions()
|
ovmauctions = getOVMAuctions()
|
||||||
@@ -52,7 +51,8 @@ def get_geonameid(auction):
|
|||||||
def getTwkAuctions(countrycode):
|
def getTwkAuctions(countrycode):
|
||||||
cachename = 'TwkAuctions_'+ countrycode
|
cachename = 'TwkAuctions_'+ countrycode
|
||||||
res = Cache.get(cachename)
|
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)
|
response = requests.get("https://api.troostwijkauctions.com/sale/4/listgrouped?batchSize=99999&CountryIDs=" + countrycode)
|
||||||
|
|
||||||
@@ -72,11 +72,13 @@ def getTwkAuctions(countrycode):
|
|||||||
def getOVMAuctions():
|
def getOVMAuctions():
|
||||||
cachename = 'OnlineVeiling_'
|
cachename = 'OnlineVeiling_'
|
||||||
res = Cache.get(cachename)
|
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")
|
response = requests.get("https://onlineveilingmeester.nl/rest/nl/veilingen?status=open&domein=ONLINEVEILINGMEESTER")
|
||||||
|
|
||||||
if(response.status_code ==200):
|
if(response.status_code ==200):
|
||||||
|
print('Got Ovm Auctions')
|
||||||
data = response.json()
|
data = response.json()
|
||||||
auctions = []
|
auctions = []
|
||||||
for result in data['veilingen']:
|
for result in data['veilingen']:
|
||||||
|
|||||||
Reference in New Issue
Block a user