Skip to content

Limit User's trackable attributes to update at most once/hour

Toon Claes requested to merge tc-cache-trackable-attributes into master

What does this MR do?

Every time a user logs in or out, the Trackable attributes are written to the database. This is causing a lot of load on the database, for data that isn't really critical.

So, when devise tries to update the trackable attributes, a Gitlab::ExclusiveLease is obtained for that user, with a timeout of 1h. When obtaining this lease fails, in case the last update was less than an hour ago, nothing happens and the trackable changes are ignored.

Are there points in the code the reviewer needs to double check?

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes gitlab-org/gitlab-ce#22068

Merge request reports

Loading