Skip to content

Commit 4c14264

Browse files
authored
v2.4.3 get users only if within last 45 days (#58)
1 parent 99d2fa4 commit 4c14264

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bot/database_service/firestore_service.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ def get_user_sheet_id(self, telegram_id, telegram_username):
9999
# Get all user IDs
100100
def get_all_user_id(self):
101101
try:
102-
users_ref = self.db.collection(self.collection_name)
102+
two_months_ago = datetime.now() - timedelta(days=45)
103+
users_ref = self.db.collection(self.collection_name).where('last_accessed', '>=', two_months_ago)
103104
user_ids = [int(user.id) for user in users_ref.stream()]
104105
return user_ids
105106
except Exception as e:

0 commit comments

Comments
 (0)