Move core matching factors to the config file
Bonus changes here were making the config a singleton, fixing some more tests and then re-writing the stress test because it was pissing me off.
This commit is contained in:
parent
a5d7dae851
commit
9043615498
6 changed files with 254 additions and 86 deletions
|
@ -130,10 +130,9 @@ class State():
|
|||
dict = self._dict
|
||||
_SCHEMA.validate(dict)
|
||||
|
||||
def get_oldest_timestamp(self) -> datetime:
|
||||
"""Grab the oldest timestamp in history"""
|
||||
times = (ts_to_datetime(dt) for dt in self._history.keys())
|
||||
return next(times, None)
|
||||
def get_history_timestamps(self) -> list[datetime]:
|
||||
"""Grab all timestamps in the history"""
|
||||
return sorted([ts_to_datetime(dt) for dt in self._history.keys()])
|
||||
|
||||
def get_user_matches(self, id: int) -> list[int]:
|
||||
return self._users.get(str(id), {}).get(_Key.MATCHES, {})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue