switched cron job to http request

This commit is contained in:
Computerboer
2024-10-19 14:43:21 +02:00
parent 5f6ae49922
commit a0e87927af
3 changed files with 32 additions and 15 deletions

17
app.py
View File

@@ -31,6 +31,23 @@ def getAllAuctions(countrycode):
print_exc(e)
return 'internal server error', 500
@app.route("/v2/refreshauction/<countrycode>")
def refreshAllAuctions(countrycode):
try:
if countrycode not in ['NL', 'BE', 'DE']:
log('country not available: ' + countrycode)
return jsonify('NOT AVAILABLE COUNTRY')
res = getAuctionlocations(countrycode, True)
return JsonEncoder().encode(res)
except Exception as e:
log('something went wrong with refreshing the auctions')
print_exc(e)
return 'internal server error' + e, 500
if __name__ == "__main__":
app.run() # run our Flask app