Skip to content
Snippets Groups Projects

Restrict last_activity_at updates to one per hour

Merged Yorick Peterse requested to merge throttle-last-activity-at into master
1 unresolved thread

What does this MR do?

This MR reduces the number of updates to projects.last_activity_at to once per hour.

Why was this MR needed?

https://gitlab.com/gitlab-org/gitlab-ce/issues/22213

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

https://gitlab.com/gitlab-org/gitlab-ce/issues/22213

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Yorick Peterse Added 75 commits:

    Added 75 commits:

  • Yorick Peterse Resolved all discussions

    Resolved all discussions

  • @rymai Done.

  • Yorick Peterse Added 1 commit:

    Added 1 commit:

    • 028c086f - Restrict last_activity_at updates to one per hour
  • Yorick Peterse Resolved all discussions

    Resolved all discussions

  • @yorickpeterse Awesome, thanks! :heart:

  • Rémy Coutable Added ~149423 label

    Added ~149423 label

  • Rémy Coutable Enabled an automatic merge when the build for 028c086f succeeds

    Enabled an automatic merge when the build for 028c086f succeeds

  • Rémy Coutable Mentioned in commit 9335953d

    Mentioned in commit 9335953d

  • Rémy Coutable Status changed to merged

    Status changed to merged

  • I think this is causing a build failure since last_activity_at can only be updated once an hour: https://gitlab.com/gitlab-org/gitlab-ce/builds/4218398

  • Stan Hu
    Stan Hu @stanhu started a thread on the diff
  • 324 326 end
    325 327
    326 328 def reset_project_activity
    327 if project && Gitlab::ExclusiveLease.new("project:update_last_activity_at:#{project.id}", timeout: 60).try_obtain
    328 project.update_column(:last_activity_at, self.created_at)
    329 end
    329 return unless project
    330
    331 # Don't even bother obtaining a lock if the last update happened less than
    332 # 60 minutes ago.
    333 return if project.last_activity_at > RESET_PROJECT_ACTIVITY_INTERVAL.ago
  • Picked into 8-12-stable, will go into RC6.

  • Rubén Dávila Removed ~149423 label

    Removed ~149423 label

  • Rémy Coutable Mentioned in commit 9c4cb45b

    Mentioned in commit 9c4cb45b

  • Please register or sign in to reply
    Loading