founders_toolkit 0.3.0 → 0.4.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3949030c0d0ccd14d3f91cf6f51f38df50fee9ba6b3480ea9fbf792fd48e02cf
4
- data.tar.gz: b776d008c899fb9f1b0ec80279dd038465130c59ba84f306f57c922d0faeb1d7
3
+ metadata.gz: 8cdef234a608001617a427f4b1fae7a5fba98ea5ee6167d5b4f9c100702c1ce1
4
+ data.tar.gz: 1ab17d05b93bb338ed98c38802863ba1c828687c1e9adc9260889ddb5cf619a7
5
5
  SHA512:
6
- metadata.gz: 63c67c68c2bddcb332aee24196afecfa40ae50fdf2fb849db7a65586426a4c5fa8fdc370035f6292a130a996832854d048f48372ff8b7c0bfe20113f4bd87621
7
- data.tar.gz: 3988e5238de63d396e0ea3ebf04a8b6c27fcb8a509742c2778a114546b2bebd608bd6555beda22191d35529809b6bcd3e16eb951c35c9f58c35ab29461c370be
6
+ metadata.gz: a22d075b2ae0b56e5d8038ba9737678c570da481e6668cdee6aeca491c09ef6d31ba08b63a24ef2e7e268f326be00e1fef9a9b77e431a645d489f63804e1494b
7
+ data.tar.gz: 28427b91f1ebc7b38b5cb95793f2f810d1a7e4efd13c9ffa8155db444d47bf737a577f5a007e20532d4edb6c811130b7f617bcb3ad3afccd13bb33ba5a53e623
data/CHANGELOG.md CHANGED
@@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.4.0] - 2021-03-29
10
+ - Add tracking to limitable
11
+
9
12
  ## [0.3.0] - 2021-03-29
10
13
  - Added TrackedJob for simple statsd active job monitoring
11
14
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- founders_toolkit (0.3.0)
4
+ founders_toolkit (0.4.0)
5
5
  activemodel (~> 6.1)
6
6
  activesupport (~> 6.1)
7
7
 
@@ -31,13 +31,15 @@ module FoundersToolkit::Util
31
31
  limiter = instance_variable_get("@#{limiter_name}".to_sym)
32
32
  limiter ||= instance_variable_set("@#{limiter_name}".to_sym, Ratelimit.new(name))
33
33
 
34
- limiter.exec_within_threshold(__send__(key), threshold: threshold, interval: interval) do
35
- result = statsd.time(['retryable', limiter_name].join('.')) do
36
- Retryable.retryable(tries: 3, on: retry_from) { block.call }
37
- end
38
- limiter.add __send__(key)
39
- result
34
+ statsd.time(['throttled', limiter_name].join('.')) do
35
+ sleep 1 while limiter.exceeded?(__send__(key), threshold: threshold, interval: interval)
40
36
  end
37
+
38
+ result = statsd.time(['retryable', limiter_name].join('.')) do
39
+ Retryable.retryable(tries: 3, on: retry_from) { block.call }
40
+ end
41
+ limiter.add __send__(key)
42
+ result
41
43
  end
42
44
  end
43
45
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FoundersToolkit
4
- VERSION = '0.3.0'
4
+ VERSION = '0.4.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: founders_toolkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Trae Robrock