Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch disconnect method for ContainerImage #15698

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/models/container_image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,10 @@ def disconnect_inv
save
end

def self.disconnect_inv(ids)
_log.info "Disconnecting ContainerImages ids [#{ids}]"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you more closely match the log message from the normal disconnect_inv ?
Maybe "Disconnecting Images [#{ids}] from EMS [#{ext_management_system.name}] id [#{ext_management_system.id}]"

Copy link
Contributor Author

@Ladas Ladas Aug 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, I don't have the EMS object here. Not sure if I should pass it for the purpose of logging? the EMS can be found in the log by looking at the process id though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right, just "Disconnecting Images... then

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

where(:id => ids).update_all(:container_image_registry_id => nil, :deleted_on => Time.now.utc)
end

alias_method :perform_metadata_sync, :sync_stashed_metadata
end