Skip to content

Commit

Permalink
Update Sentry checkin code
Browse files Browse the repository at this point in the history
  • Loading branch information
parterburn committed Jan 10, 2024
1 parent b61c1f2 commit 43f595b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
23 changes: 12 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ GEM
logtail (~> 0.1)
logtail-rack (~> 0.1)
railties (>= 3.0.0)
loofah (2.21.3)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.8.1)
Expand All @@ -282,7 +282,7 @@ GEM
mini_i18n (0.8.0)
mini_magick (4.12.0)
mini_mime (1.1.5)
mini_portile2 (2.8.2)
mini_portile2 (2.8.5)
minitest (5.20.0)
msgpack (1.6.0)
multi_json (1.15.0)
Expand All @@ -298,15 +298,15 @@ GEM
net-protocol
netrc (0.11.0)
nio4r (2.5.9)
nokogiri (1.15.2)
nokogiri (1.15.5)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
orm_adapter (0.5.0)
pg (1.5.3)
public_suffix (5.0.3)
puma (6.3.0)
nio4r (~> 2.0)
racc (1.6.2)
racc (1.7.3)
rack (2.2.8)
rack-affiliates (0.4.0)
rack
Expand Down Expand Up @@ -334,8 +334,9 @@ GEM
bundler (>= 1.15.0)
railties (= 6.1.7.3)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
Expand All @@ -346,7 +347,7 @@ GEM
method_source
rake (>= 12.2)
thor (~> 1.0)
rake (13.0.6)
rake (13.1.0)
randomized_field (1.0.0)
activerecord (>= 4.0.0)
rb-fsevent (0.10.4)
Expand Down Expand Up @@ -409,10 +410,10 @@ GEM
selenium-webdriver (3.142.7)
childprocess (>= 0.5, < 4.0)
rubyzip (>= 1.2.2)
sentry-rails (5.9.0)
sentry-rails (5.16.1)
railties (>= 5.0)
sentry-ruby (~> 5.9.0)
sentry-ruby (5.9.0)
sentry-ruby (~> 5.16.1)
sentry-ruby (5.16.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
simplecov (0.18.5)
docile (~> 1.1)
Expand All @@ -436,7 +437,7 @@ GEM
activesupport (>= 3.1)
stripe (>= 2.8, < 9)
temple (0.8.2)
thor (1.2.2)
thor (1.3.0)
tilt (2.0.10)
timeout (0.3.2)
turnstile-captcha (0.1.4)
Expand Down
6 changes: 3 additions & 3 deletions lib/tasks/entry.rake
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ namespace :entry do
end

task :send_hourly_entries => :environment do
RestClient.post("https://sentry.io/api/0/organizations/dabble-me/monitors/send_hourly_entries/checkins/", { status: "in_progress" }, { "Authorization": "DSN #{ENV['SENTRY_CRON_CHECK']}" })
check_in_id = Sentry.capture_check_in("send_hourly_entries", :in_progress)

users = User.subscribed_to_emails.not_just_signed_up
random_inspiration = Inspiration.random
Expand Down Expand Up @@ -197,10 +197,10 @@ namespace :entry do
end

# Notify Sentry your job has completed successfully:
RestClient.put("https://sentry.io/api/0/organizations/dabble-me/monitors/send_hourly_entries/checkins/latest/", { status: "ok" }, { "Authorization": "DSN #{ENV['SENTRY_CRON_CHECK']}" })
Sentry.capture_check_in("send_hourly_entries", :ok, check_in_id: check_in_id)
rescue => e
Sentry.capture_exception(e)
RestClient.put("https://sentry.io/api/0/organizations/dabble-me/monitors/send_hourly_entries/checkins/latest/", { status: "error" }, { "Authorization": "DSN #{ENV['SENTRY_CRON_CHECK']}" })
Sentry.capture_check_in("send_hourly_entries", :error, check_in_id: check_in_id)
end

task :maintenance => :environment do
Expand Down

0 comments on commit 43f595b

Please sign in to comment.