Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: OPTIC: 1809: Adding option to only update last_activity after a significant difference #7216

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

wesleylima
Copy link
Contributor

@github-actions github-actions bot added the fix label Mar 12, 2025
Copy link

netlify bot commented Mar 12, 2025

Deploy Preview for heartex-docs canceled.

Name Link
🔨 Latest commit f874d56
🔍 Latest deploy log https://app.netlify.com/sites/heartex-docs/deploys/67d1e68b5f498f00082afa43

Copy link

netlify bot commented Mar 12, 2025

Deploy Preview for label-studio-docs-new-theme canceled.

Name Link
🔨 Latest commit f874d56
🔍 Latest deploy log https://app.netlify.com/sites/label-studio-docs-new-theme/deploys/67d1e68be250ab0008fbf3cb

check_interval = getattr(settings, 'USER_LAST_ACTIVITY_CHECK_INTERVAL', None)
if check_interval:
if timezone.now() - self.last_activity < check_interval:
# Don't update last_activity because it's not necessary since it's close enough to the existing last_activity value
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we log a message here so we at least have a record somewhere of the real last_activity?

@@ -65,6 +65,12 @@ class UserLastActivityMixin(models.Model):
last_activity = models.DateTimeField(_('last activity'), default=timezone.now, editable=False)

def update_last_activity(self):
check_interval = getattr(settings, 'USER_LAST_ACTIVITY_CHECK_INTERVAL', None)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need getattr here?

@wesleylima wesleylima changed the title fix: OPTIC: 1809: Adding option to only update last_activiy after a significant difference fix: OPTIC: 1809: Adding option to only update last_activity after a significant difference Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants