From 8e6e3346e15f75e8bc0a9ba242653145c312d8cd Mon Sep 17 00:00:00 2001 From: sneakers-the-rat Date: Wed, 18 Sep 2024 21:49:57 -0700 Subject: [PATCH] accept review comments https://github.com/NeuromatchAcademy/mastodon/pull/44\#discussion_r1766143286 and https://github.com/NeuromatchAcademy/mastodon/pull/44\#discussion_r1766148179 Signed-off-by: sneakers-the-rat --- app/services/activitypub/fetch_replies_service.rb | 2 +- db/migrate/20240918233930_add_fetched_replies_at_to_status.rb | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/app/services/activitypub/fetch_replies_service.rb b/app/services/activitypub/fetch_replies_service.rb index 18b3d2eddc..c09d224263 100644 --- a/app/services/activitypub/fetch_replies_service.rb +++ b/app/services/activitypub/fetch_replies_service.rb @@ -25,7 +25,7 @@ class ActivityPub::FetchRepliesService < BaseService FetchReplyWorker.push_bulk(filtered_replies) { |reply_uri| [reply_uri, { 'request_id' => request_id, 'all_replies' => @all_replies }] } # Store last fetched all to debounce - @status.update(fetched_replies_at: Time.now.utc) if fetch_all_replies? + @status.touch(:fetched_replies_at) @items end diff --git a/db/migrate/20240918233930_add_fetched_replies_at_to_status.rb b/db/migrate/20240918233930_add_fetched_replies_at_to_status.rb index c42eff6aeb..229e43d978 100644 --- a/db/migrate/20240918233930_add_fetched_replies_at_to_status.rb +++ b/db/migrate/20240918233930_add_fetched_replies_at_to_status.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true class AddFetchedRepliesAtToStatus < ActiveRecord::Migration[7.1] - disable_ddl_transaction! - def change add_column :statuses, :fetched_replies_at, :datetime, null: true end