Skip to content

Commit

Permalink
CV2-4604: fix sentry issue (#1889)
Browse files Browse the repository at this point in the history
  • Loading branch information
melsawy authored May 13, 2024
1 parent a96b27a commit 4c892ee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/models/assignment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,12 @@ def apply_rules_and_actions
def update_elasticsearch_assignment
if ['Annotation', 'Dynamic'].include?(self.assigned_type) && self.assigned.annotation_type == 'verification_status'
pm = self.assigned.annotated
# Update ES
uids = Assignment.where(assigned_type: self.assigned_type, assigned_id: self.assigned_id).map(&:user_id)
data = { 'assigned_user_ids' => uids }
pm.update_elasticsearch_doc(data.keys, data, pm.id)
unless pm.nil?
# Update ES
uids = Assignment.where(assigned_type: self.assigned_type, assigned_id: self.assigned_id).map(&:user_id)
data = { 'assigned_user_ids' => uids }
pm.update_elasticsearch_doc(data.keys, data, pm.id)
end
end
end
end
2 changes: 2 additions & 0 deletions lib/tasks/data/project_media.rake
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,10 @@ namespace :check do
print '.'
value = pm.send(field_name, true)
end
sleep 2
end
Rails.cache.write('check:project_media:recalculate_cached_field:team_id', team.id) if data_args['slug'].blank?
sleep 5
end
minutes = ((Time.now.to_i - started) / 60).to_i
puts "[#{Time.now}] Done in #{minutes} minutes."
Expand Down

0 comments on commit 4c892ee

Please sign in to comment.