lock_and_cache 1.0.2 → 1.0.3

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
  SHA1:
3
- metadata.gz: ce75840f5c7d5b2f97e11c3e9e1cd557e7090c03
4
- data.tar.gz: 0884f62ed8c7d5e45fea3308f1eac1ea66c6960c
3
+ metadata.gz: bbcf2cc4c2e6b8f6c7af7eb5226733eb5f9d2180
4
+ data.tar.gz: ff2b4cf01475da48793e76bf5dccc1b3d437218c
5
5
  SHA512:
6
- metadata.gz: 1d326c161215f2cd475d604e38fcc4eda775c1d58e6a7d0786f013bec67c815e240f086e4000a5bd77bdd0c90ee7c8d8d47267b764b3d231be6c7f2225beec80
7
- data.tar.gz: 41740e0801216977844fdf40af31a0aea6cf5cb16d7f721fc93c3451d4090155be961f0d324aabc35bcf18960503f1de836fc770152ccacd22498a8e034ca0b0
6
+ metadata.gz: dfa83fd496ab5fbd254cf2eab5c497990610af87ec7a013735acbc7c4281961526b592f4312e83251b550dacdccf80f6ea02e368af263fc7077641692e51f294
7
+ data.tar.gz: 16aaf6d638e1f5b6c1c65cfc4d792a21ce73e5a07c164be22a53194a2f6a955346b449a7e1f4c73fab8fc017e427e15d20d73ae24d7b9593fa0147dc9c33149e
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ 1.0.3 / 2015-08-06
2
+
3
+ * Enhancements
4
+
5
+ * More granular debug output
6
+
1
7
  1.0.2 / 2015-08-06
2
8
 
3
9
  * Bug fixes
@@ -122,24 +122,26 @@ module LockAndCache
122
122
  key = LockAndCache::Key.new self, method_id, key_parts
123
123
  digest = key.digest
124
124
  storage = LockAndCache.storage
125
- Thread.exclusive { $stderr.puts "[lock_and_cache] A #{key.debug}" } if debug
125
+ Thread.exclusive { $stderr.puts "[lock_and_cache] A1 #{key.debug}" } if debug
126
126
  if storage.exists digest
127
127
  return ::Marshal.load(storage.get(digest))
128
128
  end
129
- Thread.exclusive { $stderr.puts "[lock_and_cache] B #{key.debug}" } if debug
129
+ Thread.exclusive { $stderr.puts "[lock_and_cache] B1 #{key.debug}" } if debug
130
130
  retval = nil
131
131
  lock_manager = LockAndCache.lock_manager
132
132
  lock_digest = 'lock/' + digest
133
133
  lock_info = nil
134
134
  begin
135
135
  until lock_info = lock_manager.lock(lock_digest, lock_expires)
136
+ Thread.exclusive { $stderr.puts "[lock_and_cache] C1 #{key.debug}" } if debug
136
137
  sleep lock_spin
137
138
  end
138
- Thread.exclusive { $stderr.puts "[lock_and_cache] C #{key.debug}" } if debug
139
+ Thread.exclusive { $stderr.puts "[lock_and_cache] D1 #{key.debug}" } if debug
139
140
  if storage.exists digest
141
+ Thread.exclusive { $stderr.puts "[lock_and_cache] E1 #{key.debug}" } if debug
140
142
  retval = ::Marshal.load storage.get(digest)
141
143
  else
142
- Thread.exclusive { $stderr.puts "[lock_and_cache] D #{key.debug}" } if debug
144
+ Thread.exclusive { $stderr.puts "[lock_and_cache] F1 #{key.debug}" } if debug
143
145
  retval = yield
144
146
  if expires
145
147
  storage.setex digest, expires, ::Marshal.dump(retval)
@@ -1,3 +1,3 @@
1
1
  module LockAndCache
2
- VERSION = '1.0.2'
2
+ VERSION = '1.0.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lock_and_cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seamus Abshere