lib/filbunke/client.rb in filbunke-1.6.0 vs lib/filbunke/client.rb in filbunke-1.7.0
- old
+ new
@@ -59,12 +59,10 @@
failure = failure || @async_requests.any?{|request| request.handled_response == false }
failure ? last_checkpoint : (new_checkpoint || last_checkpoint)
end
-
-
def update_files!(last_checkpoint)
with_updated_files(last_checkpoint) {}
end
def register_updated_file!(path, url, hash = nil)
@@ -130,13 +128,13 @@
else
raise "Unsupported protocol for file: #{file.inspect}"
end
end
- def run_callbacks(file)
+ def run_callbacks(file, local_file_path)
@callbacks.each do |callback|
- callback.on_update(file)
+ callback.on_update(file, local_file_path)
end
end
def file_needs_update?(file, local_file_path)
return true if file.hash.nil? || file.hash == ""
@@ -189,10 +187,10 @@
delete_file!(local_file_path)
else
@logger.log "Failed to update file #{file.url}, error code = #{response.code}"
success = false
end
- run_callbacks(file) if success
+ run_callbacks(file, local_file_path) if success
rescue StandardError => e
@logger.log "Failed to update file #{file.url}: #{e.message}"
success = false
end
success