Removed old code. Fixed store lookup on failure.

This commit is contained in:
Martin Edenhofer 2016-02-02 14:08:27 +01:00
parent c1e4171222
commit a0b3559522

View file

@ -46,13 +46,7 @@ read content of a file
def content def content
adapter = self.class.load_adapter("Store::Provider::#{provider}") adapter = self.class.load_adapter("Store::Provider::#{provider}")
c = if sha adapter.get(sha)
adapter.get(sha)
else
# fallback until migration is done
Store::Provider::DB.find_by(md5: md5).data
end
c
end end
=begin =begin
@ -78,7 +72,7 @@ in case of fixing sha hash use:
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}) current:#{sha}/db:#{item.sha}/provider:#{item.provider}" 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}" logger.error "STORE: #{store.inspect}"
if fix_it if fix_it
item.update_attribute(:sha, sha) item.update_attribute(:sha, sha)