peak_flow_utils 0.1.17 → 0.1.18

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
  SHA256:
3
- metadata.gz: 3917057ab2d29651eec619ccb60c5a6c671ce092ada22ff80269ce399a8a7bd6
4
- data.tar.gz: 25738f4241971584cfbbc9ea80cbf07f426c5dac8b6394398eb92212c8818be1
3
+ metadata.gz: 1d6ad793f87d038dc928420a3c35e046fa1fcfb4f610e4fd6bd1c9f8fa445a9e
4
+ data.tar.gz: 9abdb774bfa6fd91896dfdbe55b6d6d7e931804035712aa51e1c576ab9d4d6cf
5
5
  SHA512:
6
- metadata.gz: 144f08cb6bb1af54806406e1a9ce16ade04bea01e07cf8c16537764236f9e58d672956a9346ddc6a5088f1ed8e8a3c87ff8d02ff797f230b74e47fa685590005
7
- data.tar.gz: 324f5e6834f219cb4a51dd2c3a1df5321f4912e6586ea9a67c90d05554aeae231466b7da5dd23148cef8426aae93dc02862c91faf56c58a7fa1a1125c01b9e61
6
+ metadata.gz: ef054a48493eb11175e79cfdac7b9c2ae5258c8d67c3113bb0c61633404df7c6b674dc2fda6809a3c0ded02533f7fe88407bc4b8693a6c982d772f84a1f2de51
7
+ data.tar.gz: 6b4cd15ee4e07feabc1e0c4b6bb9efc59aff36dad76c8fae97ff9f8d1d486dc570ae5e69997f872105dffc6036e167beb00e0995b5b115561964facc12b63da2
data/README.md CHANGED
@@ -58,6 +58,26 @@ If you want the job name and its arguments logged in parameters you can execute
58
58
  PeakFlowUtils::SidekiqParametersLogging.execute!
59
59
  ```
60
60
 
61
+ ### Sidekiq and Postgres pings
62
+
63
+ Add this to `routes.rb`:
64
+ ```ruby
65
+ Rails.application.routes.draw do
66
+ mount PeakFlowUtils::Engine => "/peakflow_utils"
67
+ ```
68
+
69
+ Add these to .env variables:
70
+ ```
71
+ PEAKFLOW_PINGS_USERNAME=username
72
+ PEAKFLOW_PINGS_PASSWORD=secret-password
73
+ ```
74
+
75
+ You can now add a HTTP ping on this path:
76
+ `/peakflow_utils/pings/sidekiq`
77
+
78
+ And this for Postgres:
79
+ `/pings/postgres_connections`
80
+
61
81
  ## Contributing
62
82
  Contribution directions go here.
63
83
 
@@ -9,7 +9,7 @@ private
9
9
  authenticate_or_request_with_http_basic do |username, password|
10
10
  if ENV["PEAKFLOW_PINGS_USERNAME"].blank? || ENV["PEAKFLOW_PINGS_PASSWORD"].blank?
11
11
  Rails.logger.error "Peakflow utils: Pings called but PEAKFLOW_PINGS_USERNAME or PEAKFLOW_PINGS_PASSWORD wasn't set"
12
- false
12
+ return false
13
13
  end
14
14
 
15
15
  username == ENV.fetch("PEAKFLOW_PINGS_USERNAME") && password == ENV.fetch("PEAKFLOW_PINGS_PASSWORD")
@@ -1,7 +1,6 @@
1
- require "sidekiq/api"
2
-
3
1
  class PeakFlowUtils::Pings::SidekiqController < PeakFlowUtils::ApplicationController
4
2
  def index
3
+ require "sidekiq/api"
5
4
  sidekiq_queue = Sidekiq::Queue.new
6
5
 
7
6
  render json: {
@@ -1,3 +1,3 @@
1
1
  module PeakFlowUtils
2
- VERSION = "0.1.17".freeze
2
+ VERSION = "0.1.18".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: peak_flow_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.17
4
+ version: 0.1.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - kaspernj
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-27 00:00:00.000000000 Z
11
+ date: 2023-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails