cronitor 5.0.0 → 5.1.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 +4 -4
- data/.github/workflows/publish.yml +5 -6
- data/.github/workflows/test.yml +21 -21
- data/README.md +8 -6
- data/lib/cronitor/config.rb +2 -1
- data/lib/cronitor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac1824833468d92068ba5664ef8d667fbe2518b34caa8da2cae3a307a7a923e7
|
4
|
+
data.tar.gz: 18ff6d1f48bd6da9686930585b6eaab3d296caedb33c171a5d668c26b69fdaba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d6e6aeaaaf3c0a8e5942132e833f53169756717dfa49d52d6641dc0a644f470cac6cc2124fdaebf12fb7814b485f9a14753c78a2a059541b94662c9127279a7
|
7
|
+
data.tar.gz: e2d4da41d199b4ff8c01fa768f69f0a48303c98559a2766f537b0a25f6940df21c0ecd2c94d4318636623f230cd8ff7976b75a3219ece9cae419b6eafa8b10ff
|
@@ -15,15 +15,14 @@ jobs:
|
|
15
15
|
runs-on: ubuntu-latest
|
16
16
|
|
17
17
|
steps:
|
18
|
-
- uses: actions/checkout@
|
19
|
-
- name: Set up Ruby
|
20
|
-
uses:
|
18
|
+
- uses: actions/checkout@v3
|
19
|
+
- name: Set up Ruby
|
20
|
+
uses: ruby/setup-ruby@v1
|
21
21
|
with:
|
22
|
-
ruby-version: 2.7
|
22
|
+
ruby-version: 2.7
|
23
|
+
bundler-cache: true
|
23
24
|
- name: Build and test with Rake
|
24
25
|
run: |
|
25
|
-
gem install bundler
|
26
|
-
bundle install --jobs 4 --retry 3
|
27
26
|
bundle exec rake release
|
28
27
|
with:
|
29
28
|
api_key: ${{secrets.RUBYGEMS_API_KEY}}
|
data/.github/workflows/test.yml
CHANGED
@@ -10,25 +10,25 @@ on:
|
|
10
10
|
- master
|
11
11
|
|
12
12
|
jobs:
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
13
|
+
# lint:
|
14
|
+
# strategy:
|
15
|
+
# fail-fast: false
|
16
|
+
# matrix:
|
17
|
+
# ruby:
|
18
|
+
# - '2.7'
|
19
|
+
# - '3.0'
|
20
20
|
|
21
|
-
|
21
|
+
# runs-on: ubuntu-latest
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
23
|
+
# steps:
|
24
|
+
# - uses: actions/checkout@v2
|
25
|
+
# - name: Set up Ruby 2.7
|
26
|
+
# uses: ruby/setup-ruby@v1
|
27
|
+
# with:
|
28
|
+
# ruby-version: ${{ matrix.ruby }}
|
29
|
+
# bundler-cache: true
|
30
|
+
# - name: Run Rubocop
|
31
|
+
# run: bundle exec rake rubocop
|
32
32
|
|
33
33
|
spec:
|
34
34
|
strategy:
|
@@ -37,18 +37,18 @@ jobs:
|
|
37
37
|
ruby:
|
38
38
|
- '2.7'
|
39
39
|
- '3.0'
|
40
|
+
- '3.1'
|
41
|
+
- '3.2'
|
40
42
|
|
41
43
|
runs-on: ubuntu-latest
|
42
44
|
|
43
45
|
steps:
|
44
|
-
- uses: actions/checkout@
|
45
|
-
- name: Set up Ruby
|
46
|
+
- uses: actions/checkout@v3
|
47
|
+
- name: Set up Ruby
|
46
48
|
uses: ruby/setup-ruby@v1
|
47
49
|
with:
|
48
50
|
ruby-version: ${{ matrix.ruby }}
|
49
51
|
bundler-cache: true
|
50
52
|
- name: Build and test with Rake
|
51
53
|
run: |
|
52
|
-
gem install bundler
|
53
|
-
bundle install --jobs 4 --retry 3
|
54
54
|
bundle exec rake
|
data/README.md
CHANGED
@@ -29,8 +29,8 @@ The `Cronitor#job` helper will send telemetry events before calling your block a
|
|
29
29
|
require 'cronitor'
|
30
30
|
Cronitor.api_key = 'api_key_123'
|
31
31
|
|
32
|
-
Cronitor.job '
|
33
|
-
|
32
|
+
Cronitor.job 'important-job' do
|
33
|
+
ImportantJob.new(Date.today).run()
|
34
34
|
end
|
35
35
|
```
|
36
36
|
|
@@ -40,7 +40,7 @@ Cronitor provides a [separate library](https://github.com/cronitorio/cronitor-si
|
|
40
40
|
|
41
41
|
## Sending Telemetry Events
|
42
42
|
|
43
|
-
If you want
|
43
|
+
If you want more control over when/how [telemetry pings](https://cronitor.io/docs/telemetry-api) are sent,
|
44
44
|
you can instantiate a monitor and call `#ping`.
|
45
45
|
|
46
46
|
```ruby
|
@@ -132,7 +132,7 @@ You can also create and update monitors by calling `Monitor.put`.
|
|
132
132
|
```ruby
|
133
133
|
require 'cronitor'
|
134
134
|
|
135
|
-
monitors =
|
135
|
+
monitors = [
|
136
136
|
{
|
137
137
|
type: 'job',
|
138
138
|
key: 'send-customer-invoices',
|
@@ -148,13 +148,15 @@ monitors = Cronitor::Monitor.put([
|
|
148
148
|
request: {
|
149
149
|
url: 'https://cronitor.io'
|
150
150
|
},
|
151
|
-
schedule: 'every
|
151
|
+
schedule: 'every 60 seconds',
|
152
152
|
assertions: [
|
153
153
|
'response.code = 200',
|
154
154
|
'response.time < 600ms',
|
155
155
|
]
|
156
156
|
}
|
157
|
-
]
|
157
|
+
]
|
158
|
+
|
159
|
+
Cronitor::Monitor.put(monitors)
|
158
160
|
```
|
159
161
|
|
160
162
|
### Pause, Reset, Delete
|
data/lib/cronitor/config.rb
CHANGED
@@ -9,7 +9,7 @@ module Cronitor
|
|
9
9
|
YAML_KEYS = MONITOR_TYPES.map { |t| "#{t}s" }
|
10
10
|
|
11
11
|
class << self
|
12
|
-
attr_accessor :api_key, :api_version, :environment, :logger, :config, :timeout, :ping_timeout
|
12
|
+
attr_accessor :api_key, :api_version, :environment, :logger, :config, :timeout, :ping_timeout, :auto_discover_sidekiq
|
13
13
|
|
14
14
|
def configure(&block)
|
15
15
|
block.call(self)
|
@@ -22,6 +22,7 @@ module Cronitor
|
|
22
22
|
self.timeout = ENV.fetch('CRONITOR_TIMEOUT', nil) || 10
|
23
23
|
self.ping_timeout = ENV.fetch('CRONITOR_PING_TIMEOUT', nil) || 5
|
24
24
|
self.config = ENV.fetch('CRONITOR_CONFIG', nil)
|
25
|
+
self.auto_discover_sidekiq = ENV.fetch('CRONITOR_AUTO_DISCOVER_SIDEKIQ', 'true').casecmp('true').zero? # https://github.com/cronitorio/cronitor-sidekiq
|
25
26
|
self.logger = Logger.new($stdout)
|
26
27
|
logger.level = Logger::INFO
|
27
28
|
end
|
data/lib/cronitor/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cronitor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Byrnes
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-03-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|