Limit User's trackable attributes to update at most once/hour
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?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added - Tests
-
Added for this feature/bug -
All builds are passing
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Branch has no merge conflicts with master
(if it does - rebase it please) -
Squashed related commits together
What are the relevant issue numbers?
Closes gitlab-org/gitlab-ce#22068