Skip to content
Snippets Groups Projects
Commit a4632783 authored by Erik Johnston's avatar Erik Johnston
Browse files

Sample correctly

parent eeda4e61
Branches
Tags
No related merge requests found
...@@ -425,7 +425,9 @@ class MessageHandler(BaseHandler): ...@@ -425,7 +425,9 @@ class MessageHandler(BaseHandler):
# We also randomly point to some of the older events, to make # We also randomly point to some of the older events, to make
# sure that we don't completely ignore the older events. # sure that we don't completely ignore the older events.
new_latest_ret.extend(random.sample(latest_ret, 5)) if latest_ret[5:]:
sample_size = min(5, len(latest_ret[5:]))
new_latest_ret.extend(random.sample(latest_ret[5:], sample_size))
latest_ret = new_latest_ret latest_ret = new_latest_ret
if latest_ret: if latest_ret:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment