add haschange api endpoint

This commit is contained in:
2019-06-23 21:42:49 +02:00
parent 2820b75cdd
commit bc36a16bf5
2 changed files with 14 additions and 0 deletions

View File

@@ -49,6 +49,7 @@ def sync_to_database(players, win):
known_players[p].wins += 1
known_players[p].games += 1
known_players[p].lastUpdate = datetime.now()
updatePlayerRanks()
#############################################################
@@ -193,3 +194,10 @@ def getRankRange(start, end, revalidateRanks=False):
if start > len(playerRankList) or start >= end:
return []
return playerRankList[start:end]
def hasChanged(time):
'''Indicates to a http-querier if the availiable data has changed'''
if last_rank_update > time:
return "True"
else:
return "False"