diff options
author | Mark Chao <mchao@gitlab.com> | 2019-08-08 13:18:57 +0000 |
---|---|---|
committer | James Lopez <james@gitlab.com> | 2019-08-08 13:18:57 +0000 |
commit | 4a6f959ab8f2928225a055d9dc62647c78df5bbe (patch) | |
tree | f28f44032118d02c5b1ed23f2b8bee08c9d62402 /app/services/update_snippet_service.rb | |
parent | 8505049e1f2510642715d9bfd56fc022cd42caf0 (diff) | |
download | gitlab-ce-4a6f959ab8f2928225a055d9dc62647c78df5bbe.tar.gz |
Record usage on snippet usage
Generalize wiki page counter for other page types to extend to.
Diffstat (limited to 'app/services/update_snippet_service.rb')
-rw-r--r-- | app/services/update_snippet_service.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/services/update_snippet_service.rb b/app/services/update_snippet_service.rb index 15bc1046a4e..2969c360de5 100644 --- a/app/services/update_snippet_service.rb +++ b/app/services/update_snippet_service.rb @@ -25,6 +25,8 @@ class UpdateSnippetService < BaseService snippet.assign_attributes(params) spam_check(snippet, current_user) - snippet.save + snippet.save.tap do |succeeded| + Gitlab::UsageDataCounters::SnippetCounter.count(:update) if succeeded + end end end |