Set max limit of 24 hours on cached score

This commit is contained in:
Martin Sumner 2020-11-27 13:56:47 +00:00
parent be562c85cb
commit bcc331da10
2 changed files with 33 additions and 11 deletions

View file

@ -330,7 +330,7 @@ handle_cast({score_filelist, [Entry|Tail]}, State) ->
{LowSQN, FN, JournalP, _LK} = Entry,
ScoringState = State#state.scoring_state,
CpctPerc =
case {leveled_cdb:cdb_getcachedscore(JournalP),
case {leveled_cdb:cdb_getcachedscore(JournalP, os:timestamp()),
leveled_rand:uniform(State#state.score_onein) == 1} of
{CachedScore, UseNewScore}
when CachedScore == undefined; UseNewScore ->