Removed old code. Fixed store lookup on failure.
This commit is contained in:
parent
c1e4171222
commit
a0b3559522
1 changed files with 2 additions and 8 deletions
|
@ -46,13 +46,7 @@ read content of a file
|
|||
|
||||
def content
|
||||
adapter = self.class.load_adapter("Store::Provider::#{provider}")
|
||||
c = if sha
|
||||
adapter.get(sha)
|
||||
else
|
||||
# fallback until migration is done
|
||||
Store::Provider::DB.find_by(md5: md5).data
|
||||
end
|
||||
c
|
||||
adapter.get(sha)
|
||||
end
|
||||
|
||||
=begin
|
||||
|
@ -78,7 +72,7 @@ in case of fixing sha hash use:
|
|||
next if sha == item.sha
|
||||
success = false
|
||||
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)
|
||||
store = Store.find_by(store_file_id: item.id)
|
||||
logger.error "STORE: #{store.inspect}"
|
||||
if fix_it
|
||||
item.update_attribute(:sha, sha)
|
||||
|
|
Loading…
Reference in a new issue