mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-08 21:06:24 +08:00
Add error message to wopi discovery
Fix ambigious open call
This commit is contained in:
parent
ff47f29dc2
commit
a6ebff06a7
2 changed files with 5 additions and 4 deletions
|
@ -338,7 +338,7 @@ class Asset < ActiveRecord::Base
|
||||||
def favicon_url(action)
|
def favicon_url(action)
|
||||||
file_ext = file_file_name.split('.').last
|
file_ext = file_file_name.split('.').last
|
||||||
action = get_action(file_ext, action)
|
action = get_action(file_ext, action)
|
||||||
action.wopi_app.icon if action.wopi_app
|
action.wopi_app.icon if action.try(:wopi_app)
|
||||||
end
|
end
|
||||||
|
|
||||||
# locked?, lock_asset and refresh_lock rely on the asset
|
# locked?, lock_asset and refresh_lock rely on the asset
|
||||||
|
|
|
@ -33,7 +33,7 @@ module WopiUtil
|
||||||
Rails.logger.warn 'Initializing discovery'
|
Rails.logger.warn 'Initializing discovery'
|
||||||
discovery.destroy if discovery
|
discovery.destroy if discovery
|
||||||
|
|
||||||
@doc = Nokogiri::XML(open(ENV['WOPI_DISCOVERY_URL']))
|
@doc = Nokogiri::XML(Kernel.open(ENV['WOPI_DISCOVERY_URL']))
|
||||||
|
|
||||||
discovery = WopiDiscovery.new
|
discovery = WopiDiscovery.new
|
||||||
discovery.expires = Time.now.to_i + DISCOVERY_TTL
|
discovery.expires = Time.now.to_i + DISCOVERY_TTL
|
||||||
|
@ -65,8 +65,9 @@ module WopiUtil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
discovery
|
discovery
|
||||||
rescue
|
rescue => e
|
||||||
Rails.logger.warn 'Initialization failed'
|
Rails.logger.warn 'WOPI: initialization failed: ' + e.message
|
||||||
|
e.backtrace.each { |line| Rails.logger.error line }
|
||||||
discovery = WopiDiscovery.first
|
discovery = WopiDiscovery.first
|
||||||
discovery.destroy if discovery
|
discovery.destroy if discovery
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue