svelte-on-rails 23.1.2 → 23.1.3
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/lib/tasks/ssr_client_tasks.rake +21 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 70831d9f3ec545f37161ddfd93f51dbae4c666f55712802d5d9a26325de9af19
|
|
4
|
+
data.tar.gz: 87aa46cb59dba391882a25c92c9d9ac2f01f46cf1b7322e6aee0cf508a7b2ade
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 73ed4d4dc8932e24e63f150d2ef5afd58960e15169df302add6cd073ca47bcce4cfeee25bfc2e76eafe42bf6f431718b0f295eb421baf1247b8f111cd5de6198
|
|
7
|
+
data.tar.gz: ba6a978e3f884096136be9abd7a58997cc5bec2d65ae5a31fa2d2e05ffd97d71819259a00411ab3d3319776f31fd961b6264f8e83461f11b0707b41cccbe6266
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
namespace :svelte_on_rails do
|
|
2
2
|
|
|
3
3
|
desc "Check svelte-on-rails setup and SSR server status"
|
|
4
|
-
task :
|
|
4
|
+
task check: :environment do
|
|
5
5
|
|
|
6
6
|
@line_width = 130
|
|
7
7
|
|
|
@@ -10,6 +10,25 @@ namespace :svelte_on_rails do
|
|
|
10
10
|
cs = get_from_ssr_client(:status)
|
|
11
11
|
exit(1) unless cs
|
|
12
12
|
client_status = JSON.parse(cs).symbolize_keys
|
|
13
|
+
|
|
14
|
+
# Environment validation
|
|
15
|
+
|
|
16
|
+
if client_status[:env].to_s != Rails.env.to_s
|
|
17
|
+
puts
|
|
18
|
+
puts '*' * @line_width
|
|
19
|
+
puts 'ERROR: Environment mismatch between this rake task and the running Rails process.'
|
|
20
|
+
puts
|
|
21
|
+
puts " Rake task Rails.env : «#{Rails.env}»"
|
|
22
|
+
puts " Running Rails process env: «#{client_status[:env]}»"
|
|
23
|
+
puts
|
|
24
|
+
puts 'Run the check task with the same environment as the running server.'
|
|
25
|
+
puts
|
|
26
|
+
puts '*' * @line_width
|
|
27
|
+
exit(1)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# SSR Client INFO
|
|
31
|
+
|
|
13
32
|
configs = SvelteOnRails::Configuration.instance
|
|
14
33
|
socket_path = client_status[:socket_path]
|
|
15
34
|
|
|
@@ -71,6 +90,7 @@ namespace :svelte_on_rails do
|
|
|
71
90
|
total_kb = ps_stdout.each_line.sum { |line| line.to_i }
|
|
72
91
|
|
|
73
92
|
puts " #{human_bytes(total_kb*1024)} for #{pids.size} node #{'process'.pluralize(pids.size)}"
|
|
93
|
+
puts " Redis namespace: #{SvelteOnRails::Configuration.instance.redis_namespace}"
|
|
74
94
|
|
|
75
95
|
redis_entries = SvelteOnRails::Cache.redis_entries(silent: true)
|
|
76
96
|
total_bytes = redis_entries.sum { |e| e[:bytes] }
|