diff --git a/app/workers/post_receive.rb b/app/workers/post_receive.rb index 68a0934e2b7c5f2d2419972dcfa6023f722c5367..329ccfc63627168ececafb1c483ceb98a469f5d5 100644 --- a/app/workers/post_receive.rb +++ b/app/workers/post_receive.rb @@ -85,6 +85,7 @@ def process_snippet_changes(post_received, snippet) replicate_snippet_changes(snippet) expire_caches(post_received, snippet.repository) + snippet.touch Snippets::UpdateStatisticsService.new(snippet).execute end diff --git a/spec/workers/post_receive_spec.rb b/spec/workers/post_receive_spec.rb index 4ddb793516ff9a25d3609b74f682cf3cab87744f..d632ca39e448e2d6a2a7dd7f99a8da9fec885975 100644 --- a/spec/workers/post_receive_spec.rb +++ b/spec/workers/post_receive_spec.rb @@ -452,6 +452,12 @@ def perform(changes: base64_changes) perform end + it 'updates the snippet model updated_at' do + expect(snippet).to receive(:touch) + + perform + end + it 'updates snippet statistics' do expect(Snippets::UpdateStatisticsService).to receive(:new).with(snippet).and_call_original