svelte-on-rails 20.0.0 → 20.0.1
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/svelte_on_rails/ssr_server.rb +26 -6
- 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: 3470569ee0e4c7a498f8823f43680480544ca05fd76ba2097b6fe318b39a4769
|
|
4
|
+
data.tar.gz: cc2fef9fd7a1f19adc861c217f3acb9a680e41e77a4ea533702b2cef8b8e2c18
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '0352853be00bd09718d027301dd56f59ff33efe9724865fc2e5f4d2136a9a1eb08311ade225bdf11b0dbb02e310ae5cf5cd909902adfb57e0a5b6e02d4d26b0f'
|
|
7
|
+
data.tar.gz: 43799439d12d04eb96b72eda8bb61c42ed6147ad32b915256d6d0a9e14d3f0a8433c7ceaa5da18baae756fa7193b3c290c6f7560237fc6f14bded5e711aabb75
|
|
@@ -301,13 +301,33 @@ module SvelteOnRails
|
|
|
301
301
|
end
|
|
302
302
|
|
|
303
303
|
def start_server_log(start_time, msg)
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
304
|
+
line =
|
|
305
|
+
if start_time
|
|
306
|
+
ms = ((Time.now - start_time) * 1000).round(1)
|
|
307
|
+
"[SOR] #{msg} (#{ms}ms)"
|
|
308
|
+
else
|
|
309
|
+
"[SOR] #{msg}"
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
puts line
|
|
310
313
|
$stdout.flush
|
|
314
|
+
|
|
315
|
+
sor_debug_log(line)
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
def sor_debug_log(line)
|
|
319
|
+
base = Rails.root.join('tmp')
|
|
320
|
+
|
|
321
|
+
FileUtils.mkdir_p(base) unless File.directory?(base)
|
|
322
|
+
path = File.join(base.to_s, 'sor.log')
|
|
323
|
+
|
|
324
|
+
File.open(path, 'a') do |f|
|
|
325
|
+
f.sync = true
|
|
326
|
+
f.puts("[#{Time.now.utc.iso8601(3)}] [pid=#{Process.pid}] #{line}")
|
|
327
|
+
end
|
|
328
|
+
rescue => e
|
|
329
|
+
# Last resort: write the failure itself to stderr; never raise.
|
|
330
|
+
warn "[SOR] sor_debug_log failed: #{e.class}: #{e.message}"
|
|
311
331
|
end
|
|
312
332
|
|
|
313
333
|
def stop_server_timeout!(start_time, timeout: 2000)
|