aaf-mdqt 0.8.13 → 0.8.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: be1d63bb8a3f20d6772c04152459512179d1c5df970c8883d1e0f9f9fbd0d00e
4
- data.tar.gz: 7261668be892cf1433722f655cf41e61fb7311b5cbed7bdcc47caa601ce7d964
3
+ metadata.gz: 7929ecbf467dbb395407005ef1407a2f4276695f8cacc08e1bb1bbce360591da
4
+ data.tar.gz: b670d1371d69d88768a9df9630088ad53661e2afbf3e3eb02ed1c713c3cb6137
5
5
  SHA512:
6
- metadata.gz: d8481f1e063048dbd4db16e7f336e92f499caef97eb9280c6e1ee59eee76950c79148ce4c09a78d38cefef051dc8596a156a7e79e5927489f7cd323d50ba08d3
7
- data.tar.gz: 154585d4d68116270865225b47d9dceb4dc0dbc73bdfc3789fa40d38eb5d82f36515de2e46330a49d144d32330463a997ba0d4471334673936947f4836e3ce00
6
+ metadata.gz: a489c45d3989e394060d2f89fbca2d9acb60aec0250d15955cd9dcb83ab5a65206153485770a17cf5d8d50b2f20072b5a06105eeb4a764d4c4b688458107afa2
7
+ data.tar.gz: c4d3113018774a358b8afa5de9f9ecd9bcf39bb682211763728fc007cb07ad129cf54c10a958871861af2ceaf7ac72ce9312cf27df6c987a864fa4365a46e6fa
@@ -144,7 +144,7 @@ module MDQT
144
144
  end
145
145
 
146
146
  def connection
147
- Faraday.new(:url => base_url) do |faraday|
147
+ con = Faraday.new(:url => base_url) do |faraday|
148
148
  faraday.request :url_encoded
149
149
  faraday.response :follow_redirects
150
150
  if cache?
@@ -161,6 +161,24 @@ module MDQT
161
161
  #faraday.response :logger
162
162
  faraday.adapter :httpx
163
163
  end
164
+ enable_cache_logging if verbose?
165
+ con
166
+ end
167
+
168
+ def enable_cache_logging
169
+ ActiveSupport::Notifications.subscribe "http_cache.faraday" do |*args|
170
+ event = ActiveSupport::Notifications::Event.new(*args)
171
+ cache_status = event.payload[:cache_status]
172
+
173
+ case cache_status
174
+ when :fresh, :valid
175
+ STDERR.puts "cache hit"
176
+ when :invalid, :miss
177
+ STDERR.puts "cache miss"
178
+ when :unacceptable
179
+ STDERR.puts "cache ???"
180
+ end
181
+ end
164
182
  end
165
183
 
166
184
  def default_store_config
@@ -168,7 +186,7 @@ module MDQT
168
186
  when :none, nil
169
187
  nil
170
188
  when :file, :files
171
- File.absolute_path(File.join(Dir.tmpdir, 'mdqt_cache'))
189
+ File.absolute_path(File.join('tmp', 'cache', 'mdqt'))
172
190
  when :memcached, :memcache
173
191
  'localhost:11211'
174
192
  end
@@ -191,4 +209,4 @@ module MDQT
191
209
 
192
210
  end
193
211
 
194
- end
212
+ end
data/lib/mdqt/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module MDQT
2
- VERSION = "0.8.13"
2
+ VERSION = "0.8.14"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aaf-mdqt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.13
4
+ version: 0.8.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pete Birkinshaw
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2025-02-17 00:00:00.000000000 Z
12
+ date: 2025-02-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: commander