hitnmiss 2.2.0.pre.rc.1 → 2.2.0.pre.rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -0
- data/lib/hitnmiss/background_refresh_repository.rb +12 -12
- data/lib/hitnmiss/repository.rb +1 -1
- data/lib/hitnmiss/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6b7ae5379c67097c3d00460e21f1479c79d492d1
|
|
4
|
+
data.tar.gz: 955c0a75c52a33d70ed6071c15d5413352bf7586
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 12c108488fdb1ea6560cb3ab1785859bdd5cbf1f24e2fd61cdaddf8362a1311e2b037709173283a8aa7a7d635749fdce29e37614a7302ac2a21e8a295f59b0c7
|
|
7
|
+
data.tar.gz: ed1a299f84207faeb211032d8d34fc7c5aa16b00d69b8ef4422cfea4b3238c72f1e7891663804f18d784a023406fb53fc2f894dc0539203d27ad61fb1003d56e
|
data/CHANGELOG.md
CHANGED
|
@@ -6,7 +6,7 @@ module Hitnmiss
|
|
|
6
6
|
class RefreshIntervalRequired < StandardError; end
|
|
7
7
|
|
|
8
8
|
def self.included(mod)
|
|
9
|
-
mod.
|
|
9
|
+
mod.include(OptionalLogger::LoggerManagement)
|
|
10
10
|
mod.include(Repository::CacheManagement)
|
|
11
11
|
mod.extend(ClassMethods)
|
|
12
12
|
mod.include(InstanceMethods)
|
|
@@ -34,39 +34,39 @@ module Hitnmiss
|
|
|
34
34
|
end
|
|
35
35
|
|
|
36
36
|
def refresh(*args, swallow_exceptions: [])
|
|
37
|
-
|
|
37
|
+
logger.debug("hitnmiss: refresh(#{args.inspect}, swallow_exceptions: #{swallow_exceptions.inspect}) called")
|
|
38
38
|
if swallow_exceptions.empty?
|
|
39
|
-
|
|
39
|
+
logger.debug("hitnmiss: refresh(#{args.inspect}, swallow_exceptions: #{swallow_exceptions.inspect}) about to check stale?")
|
|
40
40
|
if stale?(*args)
|
|
41
|
-
|
|
41
|
+
logger.debug("hitnmiss: refresh(#{args.inspect}, swallow_exceptions: #{swallow_exceptions.inspect}) is stale, about to prime")
|
|
42
42
|
prime(*args)
|
|
43
43
|
end
|
|
44
44
|
else
|
|
45
45
|
begin
|
|
46
|
-
|
|
46
|
+
logger.debug("hitnmiss: refresh(#{args.inspect}, swallow_exceptions: #{swallow_exceptions.inspect}) about to check stale?")
|
|
47
47
|
if stale?(*args)
|
|
48
|
-
|
|
48
|
+
logger.debug("hitnmiss: refresh(#{args.inspect}, swallow_exceptions: #{swallow_exceptions.inspect}) is stale, about to prime")
|
|
49
49
|
prime(*args)
|
|
50
50
|
end
|
|
51
51
|
rescue *swallow_exceptions => e
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
logger.error("hitnmiss: refresh(#{args.inspect}, swallow_exceptions: #{swallow_exceptions.inspect}) swallowed exception: #{e.inspect}")
|
|
53
|
+
logger.error(e.backtrace.join("\n"))
|
|
54
54
|
end
|
|
55
55
|
end
|
|
56
56
|
end
|
|
57
57
|
|
|
58
58
|
def background_refresh(*args, swallow_exceptions: [])
|
|
59
|
-
|
|
59
|
+
logger.debug("hitnmiss: background_refresh(#{args.inspect}) called")
|
|
60
60
|
@refresh_thread = Thread.new(self, args) do |repository, args|
|
|
61
61
|
while(true) do
|
|
62
|
-
repository.
|
|
62
|
+
repository.logger.debug("hitnmiss: background_refresh(#{args.inspect}): about to call refresh()")
|
|
63
63
|
refresh(*args, swallow_exceptions: swallow_exceptions)
|
|
64
|
-
repository.
|
|
64
|
+
repository.logger.debug("hitnmiss: background_refresh(#{args.inspect}): about to sleep for #{repository.class.refresh_interval}")
|
|
65
65
|
sleep repository.class.refresh_interval
|
|
66
66
|
end
|
|
67
67
|
end
|
|
68
68
|
@refresh_thread.abort_on_exception = true
|
|
69
|
-
|
|
69
|
+
logger.debug("hitnmiss: background_refresh(#{args.inspect}) enabled abort on exception")
|
|
70
70
|
end
|
|
71
71
|
|
|
72
72
|
private
|
data/lib/hitnmiss/repository.rb
CHANGED
|
@@ -3,7 +3,7 @@ require 'hitnmiss/repository/cache_management'
|
|
|
3
3
|
module Hitnmiss
|
|
4
4
|
module Repository
|
|
5
5
|
def self.included(mod)
|
|
6
|
-
mod.
|
|
6
|
+
mod.include(OptionalLogger::LoggerManagement)
|
|
7
7
|
mod.include(CacheManagement)
|
|
8
8
|
mod.extend(ClassMethods)
|
|
9
9
|
mod.include(InstanceMethods)
|
data/lib/hitnmiss/version.rb
CHANGED