Skip to content

Commit f0095d5

Browse files
committed
CV2-6681: fix rake tasks
1 parent 7156e50 commit f0095d5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/tasks/migrate/20260308070358_delete_slack_notification_cached_fields.rake

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace :check do
66
last_team_id = Rails.cache.read('check:migrate:delete_slack_notification_cached_data') || 0
77
Team.where('id > ?', last_team_id).find_each do |team|
88
puts "Processing team #{team.id}\n"
9-
puts "\nDelete cache for smooch_user\n"
9+
puts "\nDelete cache for smooch_user[#{team.id}]\n"
1010
Annotation.where(annotated_type: 'Team', annotated_id: team.id, annotation_type: 'smooch_user')
1111
.find_in_batches(batch_size: 1000) do |annotations|
1212
a_ids = annotations.pluck(:id)
@@ -29,10 +29,9 @@ namespace :check do
2929
end
3030
end
3131
# Delete `slack_message` annotations
32-
puts "\nDelete PG data for slack message annotations\n"
33-
smooch = BotUser.smooch_user
32+
puts "\nDelete PG data for slack message annotations[#{team.id}]\n"
3433
fields = ["slack_message_id", "slack_message_channel", "slack_message_attachments", "slack_message_token"]
35-
team.project_medias.where(user_id: smooch.id).find_in_batches(batch_size: 1000) do |items|
34+
team.project_medias.find_in_batches(batch_size: 1000) do |items|
3635
pm_ids = items.pluck(:id)
3736
Annotation.where(annotated_type: 'ProjectMedia', annotated_id: pm_ids, annotation_type: 'slack_message')
3837
.find_in_batches(batch_size: 1000) do |annotations|

lib/tasks/migrate/20260311134639_disable_audio_similarity.rake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ namespace :check do
77
if tbi.get_audio_similarity_enabled
88
print '.'
99
tbi.set_audio_similarity_enabled = false
10-
tbi.save!
10+
settings = tbi.settings
11+
tbi.update_column(:settings, settings)
1112
end
1213
end
1314
end

0 commit comments

Comments
 (0)