caddy 1.5.0 → 1.5.1

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: 4d0bb8c605dbc32dbcb05731e669f1ccf00f58c7
4
- data.tar.gz: 664c4aca36f43b4b6a441f54eaf9ca7a25c0d9b0
3
+ metadata.gz: 53c6371c7ae4a7d4187d15a3e001e54956038497
4
+ data.tar.gz: 065bb3be46129e37bc971db5be7bf5de573064b0
5
5
  SHA512:
6
- metadata.gz: 5420367fd7d24dfe740513085f54e8ec63646507e687deb6b8d9de37463991023c3a417c098ff26123602153d58ec66d4bf3a4b0abb08c40b24c1cb7dc581405
7
- data.tar.gz: de4e27a4e7e66d956acde7a442943268b44e11a0f1f7c193d0a4e77b96952397600dc9b91c28cd6d7e4850e9ac7594e300e1b7543c01a77317f1d98fcc904849
6
+ metadata.gz: 03ea3bd82390a146981ee37b90e6215481e47775c5e6ffa1257bb07349d49a05cb6396373566f1fcf4807eda93a89ec3fe6ee79826ac5252de017fa559768731
7
+ data.tar.gz: 8f5002ebd4b6ddec46535225a1ce1f4c20602a601c1673bc46a40f2d51744f929d8e83cd8977feab04d3d61bd37cc54193226ee9ce35a849a07a8f8fee536746
data/README.md CHANGED
@@ -38,7 +38,9 @@ end
38
38
 
39
39
  ## Error handling
40
40
 
41
- As Caddy refreshers are run in threads, exceptions are not normally reported (except by default in the logs). To add a programmatic error handler:
41
+ As Caddy refreshers are run in threads, exceptions are not normally reported (except by default in the logs). If your refresher errors out (or times out, which can happen if your refresher takes as long as your refresh interval to run) your error handler will be called and the cache value will remain what it was before it errored. This means your application may use stale values until your refresher stops erroring.
42
+
43
+ To add a programmatic error handler:
42
44
 
43
45
  ```ruby
44
46
  Caddy[:flags].refresher = -> { SomeFlagService.fetch_flags }
data/changelog.md ADDED
@@ -0,0 +1,31 @@
1
+ ## 1.5.1
2
+
3
+ - Add back in alerting if you attempt to load a cache before the refresher has run.
4
+ - Improve documentation on error handling.
5
+
6
+ ## 1.5.0
7
+
8
+ - Support for multiple cache stores, like: `Caddy[:foo][:baz]` instead of just `Caddy[:baz]`
9
+ - Additional tests.
10
+ - Additional documentation for the new feature.
11
+
12
+ ## 1.0.1
13
+
14
+ - More tests.
15
+ - Stop caching nil values returned after refreshers timeout or throw an exception (fall back on the last cached value).
16
+ - Additional documentation.
17
+
18
+ ## 1.0.0
19
+
20
+ - First draft of tests.
21
+ - More clean & refactoring.
22
+ - Style guide.
23
+ - Documentation.
24
+
25
+ ## 0.0.2
26
+
27
+ - Code cleanup, refactoring.
28
+
29
+ ## 0.0.1
30
+
31
+ - First release.
data/lib/caddy/cache.rb CHANGED
@@ -19,6 +19,7 @@ module Caddy
19
19
 
20
20
  def cache
21
21
  raise "Please run `Caddy.start` before attempting to access the cache" unless @task && @task.running?
22
+ raise "Caddy cache access before initial load; allow some more time for your app to start up" unless @cache
22
23
 
23
24
  @cache
24
25
  end
data/lib/caddy/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Caddy
3
- VERSION = "1.5.0".freeze
3
+ VERSION = "1.5.1".freeze
4
4
  end
data/test/caddy_test.rb CHANGED
@@ -20,6 +20,7 @@ class CaddyTest < Minitest::Test
20
20
  sleep(0.1)
21
21
 
22
22
  assert_equal "bar", Caddy[:test][:foo]
23
+ assert_equal "bar", Caddy[:test].cache[:foo]
23
24
  end
24
25
 
25
26
  def test_basic_interval_updating
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caddy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Elser
@@ -82,6 +82,7 @@ files:
82
82
  - README.md
83
83
  - Rakefile
84
84
  - caddy.gemspec
85
+ - changelog.md
85
86
  - docs/architecture.dot
86
87
  - docs/architecture.svg
87
88
  - lib/caddy.rb