routemaster-drain 2.5.1 → 2.5.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 +8 -3
- data/Gemfile.lock +1 -1
- data/gemfiles/rails_3.gemfile.lock +1 -1
- data/gemfiles/rails_4.gemfile.lock +1 -1
- data/gemfiles/rails_5.gemfile.lock +1 -1
- data/lib/routemaster/drain.rb +1 -1
- data/lib/routemaster/jobs/cache_and_sweep.rb +11 -4
- data/spec/routemaster/jobs/cache_and_sweep_spec.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e5b1d310a24d14ffe3335b5c63c40de0fdc9757
|
4
|
+
data.tar.gz: e7ee5a5854c5cf4cb4fa8af9ffaaadf6bb620289
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e72b8ba79a1e267735fc66972218ece1a9f612ce726aa68ee4787022e25c693f8d31edb726871d581d0f9a38390dfd02098c08fc0e3f5308e75f8502dfe3ffe
|
7
|
+
data.tar.gz: 7c9e07067f21c1d2720fafed636d552b6981b0b2fe77a38ea489d59b431d7eeb6bac7b8f3192cb534539b68a4143c3dc2263ee26379da6cc359c056f13ff0917
|
data/CHANGELOG.md
CHANGED
@@ -1,13 +1,18 @@
|
|
1
|
+
### 2.5.2 (2017-05-11)
|
2
|
+
|
3
|
+
Bug fixes
|
4
|
+
|
5
|
+
- Bust the cache when the resource is not found (#48)
|
6
|
+
|
1
7
|
### 2.5.1 (2017-05-10)
|
2
8
|
|
3
9
|
Features:
|
4
10
|
|
5
11
|
- Adds the `Siphon` middleware to `CacheBusting` drain (#45)
|
6
12
|
|
7
|
-
Bug fixes
|
8
|
-
|
9
|
-
- Sweep from dirty map if resource is missing (#47)
|
13
|
+
Bug fixes
|
10
14
|
|
15
|
+
- Sweep the dirty map if a resource is missing (#47)
|
11
16
|
|
12
17
|
### 2.5.0 (2017-04-11)
|
13
18
|
|
data/Gemfile.lock
CHANGED
data/lib/routemaster/drain.rb
CHANGED
@@ -3,18 +3,25 @@ require 'routemaster/dirty/map'
|
|
3
3
|
|
4
4
|
module Routemaster
|
5
5
|
module Jobs
|
6
|
-
# Caches a URL using {Cache}
|
7
|
-
# if
|
6
|
+
# Caches a URL using {Cache} and sweeps the dirty map if successful.
|
7
|
+
# Busts the cache if the resource was deleted.
|
8
8
|
class CacheAndSweep
|
9
9
|
def perform(url)
|
10
10
|
Dirty::Map.new.sweep_one(url) do
|
11
11
|
begin
|
12
|
-
|
12
|
+
cache.get(url)
|
13
13
|
rescue Errors::ResourceNotFound
|
14
|
-
|
14
|
+
cache.bust(url)
|
15
|
+
true
|
15
16
|
end
|
16
17
|
end
|
17
18
|
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def cache
|
23
|
+
@cache ||= Routemaster::Cache.new
|
24
|
+
end
|
18
25
|
end
|
19
26
|
end
|
20
27
|
end
|
@@ -25,6 +25,14 @@ RSpec.describe Routemaster::Jobs::CacheAndSweep do
|
|
25
25
|
|
26
26
|
subject.perform(url)
|
27
27
|
end
|
28
|
+
|
29
|
+
it 'busts the cached version of the resource' do
|
30
|
+
expect_any_instance_of(Routemaster::Cache)
|
31
|
+
.to receive(:bust)
|
32
|
+
.with(url)
|
33
|
+
|
34
|
+
subject.perform(url)
|
35
|
+
end
|
28
36
|
end
|
29
37
|
|
30
38
|
context 'when there is any other error' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: routemaster-drain
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julien Letessier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|