diff options
author | 2022-10-09 17:49:20 +0100 | |
---|---|---|
committer | 2022-10-09 17:49:20 +0100 | |
commit | 73c154182d573ec3b39f9a2abe9058b0eeb549a2 (patch) | |
tree | a823d7e2fa519b98db5c88ae9a07a80b1e19ed9b | |
parent | Use scoring system that weights age and number of entries (diff) |
Make changes requested in review
-rw-r--r-- | bot/exts/recruitment/talentpool/_review.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/bot/exts/recruitment/talentpool/_review.py b/bot/exts/recruitment/talentpool/_review.py index 20c01a712..2d5cc7ca3 100644 --- a/bot/exts/recruitment/talentpool/_review.py +++ b/bot/exts/recruitment/talentpool/_review.py @@ -32,7 +32,7 @@ MAX_MESSAGE_SIZE = 2000 MAX_EMBED_SIZE = 4000 # Maximum number of active reviews -MAX_ONGOING_REVIEWS = 4 +MAX_ONGOING_REVIEWS = 3 # Minimum time between reviews MIN_REVIEW_INTERVAL = timedelta(days=1) # Minimum time between nomination and sending a review @@ -92,7 +92,8 @@ class Reviewer: continue if is_first_message: - if msg.created_at > datetime.now(timezone.utc) - MIN_REVIEW_INTERVAL: + time_since_message_created = datetime.now(timezone.utc) - msg.created_at + if time_since_message_created < MIN_REVIEW_INTERVAL: log.debug("Most recent review was less than %s ago, cancelling check", MIN_REVIEW_INTERVAL) return False @@ -120,9 +121,10 @@ class Reviewer: """ possible = [] for user_id, user_data in self._pool.cache.items(): + time_since_nomination = datetime.now(timezone.utc) - isoparse(user_data["inserted_at"]) if ( not user_data["reviewed"] - and isoparse(user_data["inserted_at"]) < datetime.now(timezone.utc) - MIN_NOMINATION_TIME + and time_since_nomination > MIN_NOMINATION_TIME ): possible.append((user_id, user_data)) |