pg_rails 7.0.8.pre.alpha.92 → 7.0.8.pre.alpha.94
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e21333fd287d450bce56ad59616a460a5f6113e7f28c7d934eddc833abe756a
|
4
|
+
data.tar.gz: 1dcd5fe3cf91b2ca87acaec28b2fe5959f167cac952481613ac9b1a15df4906d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01d4202326e81d7f125d17fae6ee75f39d993802d66b45ea8af9cf844206cbef1a239e819de4d4a4e289d63e31c596ec3957b69f3ba66ec13a07816be1e48d45
|
7
|
+
data.tar.gz: c874ed529e846c531314eb161f1933d9d9e471735a88ecd7eeba3d046ac3f7f34bd8793c309ee154c6286a83ce16bedfbfbb196e096045f4cf8d606097300c18
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module PgEngine
|
2
|
+
class HealthController < ApplicationController
|
3
|
+
rescue_from(Exception) do |error|
|
4
|
+
pg_err error
|
5
|
+
render_down
|
6
|
+
end
|
7
|
+
|
8
|
+
def show
|
9
|
+
check_redis
|
10
|
+
check_postgres
|
11
|
+
render_up
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def check_postgres
|
17
|
+
return if User.count.is_a? Integer
|
18
|
+
|
19
|
+
raise PgEngine::Error, 'postgres is down'
|
20
|
+
end
|
21
|
+
|
22
|
+
def check_redis
|
23
|
+
return if Kredis.counter('healthcheck').increment.is_a? Integer
|
24
|
+
|
25
|
+
raise PgEngine::Error, 'redis is down'
|
26
|
+
end
|
27
|
+
|
28
|
+
def render_up
|
29
|
+
render html: html_status(color: '#005500')
|
30
|
+
end
|
31
|
+
|
32
|
+
def render_down
|
33
|
+
render html: html_status(color: '#990000'), status: :internal_server_error
|
34
|
+
end
|
35
|
+
|
36
|
+
def html_status(color:)
|
37
|
+
# rubocop:disable Rails/OutputSafety
|
38
|
+
%(<!DOCTYPE html><html><body style="background-color: #{color}"></body></html>).html_safe
|
39
|
+
# rubocop:enable Rails/OutputSafety
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
data/pg_engine/config/routes.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
include PgEngine::RouteHelpers
|
2
2
|
|
3
3
|
Rails.application.routes.draw do
|
4
|
+
get "pg_engine/health" => "pg_engine/health#show", as: :pg_engine_health_check
|
4
5
|
namespace :public, path: '' do
|
5
6
|
pg_resource(:mensaje_contactos, only: [:new, :create], path: 'contacto')
|
6
7
|
post 'webhook/mailgun', to: 'webhooks#mailgun'
|
data/pg_rails/lib/version.rb
CHANGED
data/pg_rails/scss/pg_rails.scss
CHANGED
@@ -11,12 +11,16 @@ $teal: #20c997 !default;
|
|
11
11
|
$cyan: #0dcaf0 !default;
|
12
12
|
|
13
13
|
// Overriding some of the default colours
|
14
|
+
$yellow: #ffb401;
|
14
15
|
$orange: #e35b17;
|
15
16
|
$red: #a70101;
|
16
17
|
|
17
|
-
$warning: $
|
18
|
+
$warning: $yellow;
|
18
19
|
$info: #87accc;
|
19
20
|
|
21
|
+
$warning-text-emphasis: $orange;
|
22
|
+
$danger-text-emphasis: #910303;
|
23
|
+
|
20
24
|
$font-size-base: 0.9rem;
|
21
25
|
$enable-validation-icons: false;
|
22
26
|
$focus-ring-width: .05rem;
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pg_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.0.8.pre.alpha.
|
4
|
+
version: 7.0.8.pre.alpha.94
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martín Rosso
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -983,6 +983,7 @@ files:
|
|
983
983
|
- pg_engine/app/controllers/concerns/pg_engine/resource.rb
|
984
984
|
- pg_engine/app/controllers/pg_engine/base_controller.rb
|
985
985
|
- pg_engine/app/controllers/pg_engine/devise_controller.rb
|
986
|
+
- pg_engine/app/controllers/pg_engine/health_controller.rb
|
986
987
|
- pg_engine/app/controllers/pg_engine/require_sign_in.rb
|
987
988
|
- pg_engine/app/controllers/public/mensaje_contactos_controller.rb
|
988
989
|
- pg_engine/app/controllers/public/webhooks_controller.rb
|