Skip to content

Commit

Permalink
Make RMAU calculations actually correct
Browse files Browse the repository at this point in the history
  • Loading branch information
tadzik committed Nov 5, 2021
1 parent 91978fe commit 8b981f9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mautrix_telegram/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ async def count_logged_in_users(self) -> int:

async def _update_active_puppet_metric(self) -> None:
active_users = UserActivity.get_active_count(
self.config['bridge.limits.puppet_inactivity_days'],
self.config['bridge.limits.min_puppet_activity_days'],
self.config['bridge.limits.puppet_inactivity_days'],
)

block_on_limit_reached = self.config['bridge.limits.block_on_limit_reached']
Expand Down
2 changes: 1 addition & 1 deletion mautrix_telegram/db/user_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def update_for_puppet(cls, puppet: 'Puppet', activity_dt: datetime) -> None:

@classmethod
def get_active_count(cls, min_activity_days: int, max_activity_days: Optional[int]) -> int:
current_ms = time.time() / 1000
current_ms = time.time() * 1000
active_count = 0
for user in cls._select_all():
activity_days = (user.last_activity_ts - user.first_activity_ts / 1000) / ONE_DAY_MS
Expand Down

0 comments on commit 8b981f9

Please sign in to comment.