Relax the updating of last_used_at of ssh keys when performing fetches.
When a user performs a git-operation through ssh using an SSH key, we update the last_used_at field in the database when gitlab-shell is calling /internal/allowed.
Since that endpoint is called multiple times during the single action (by GitLab-shell and Gitaly), it could end up being called multiple times a second.
I think we should ease this off a bit and move the actual update into sidekiq so the endpoint performs less writes and perhaps can rely only on secondaries.
Additional context
Since ~ Feb 2021, GitLab.com showed "Last used: Never" even when keys are used. In Feb 2022 GitLab.com now shows "Unavailable". This issue will allow GitLab.com to show correct SSH key usage information.
Edited by Nick Malcolm