Improved logging.

This commit is contained in:
Martin Edenhofer 2016-02-02 13:50:49 +01:00
parent fb17c49c8c
commit c1e4171222
3 changed files with 28 additions and 28 deletions

View file

@ -75,11 +75,11 @@ in case of fixing sha hash use:
content = item.content content = item.content
sha = Digest::SHA256.hexdigest(content) sha = Digest::SHA256.hexdigest(content)
logger.info "CHECK: Store::File.find(#{item.id})" logger.info "CHECK: Store::File.find(#{item.id})"
next if sha == item.sha next if sha == item.sha
success = false success = false
logger.error "DIFF: sha diff of Store::File.find(#{item.id}) " logger.error "DIFF: sha diff of Store::File.find(#{item.id}) current:#{sha}/db:#{item.sha}/provider:#{item.provider}"
store = Store.find(store_file_id: item.id)
logger.error "STORE: #{store.inspect}"
if fix_it if fix_it
item.update_attribute(:sha, sha) item.update_attribute(:sha, sha)
end end