solid_log-core 0.2.0 → 0.2.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/puma/plugin/solid_log.rb +9 -9
- data/lib/solid_log/core/services/batch_parsing_service.rb +3 -3
- data/lib/solid_log/core/services/migration_generator.rb +1 -1
- data/lib/solid_log/core/services/migration_runner.rb +1 -1
- data/lib/solid_log/core/version.rb +1 -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: 57666e95b9a34b0195d26534e72bd914038f1a695e4de7b7d7f6f45b34378466
|
|
4
|
+
data.tar.gz: b53d3cb3cf353a7346a71addaff504f3747348df7c1657d16900e43a8032b000
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ef71b13f98dad7c71afdd4af342e3c9fbb7c52e47160960f772f3726a74d530ca4b0e1ca1845143908303d4452c08077040f51c501dc0d5b6be99e34ced9751c
|
|
7
|
+
data.tar.gz: 1991d2cb34051a8d2ea0ca99033a1cd6d6965d9840ee03d0e58755adc1c5e2171db6ddc2927cb90a52bdca0a86424ac13a61d26ef6cc8ff8b81c5701c586c41c
|
|
@@ -49,11 +49,11 @@ Puma::Plugin.create do
|
|
|
49
49
|
# Check if we're not in a Rails console or runner
|
|
50
50
|
# Console and runner set DISABLE_SPRING or have IRB/Runner in ARGV
|
|
51
51
|
return false if defined?(Rails::Console)
|
|
52
|
-
return false if $PROGRAM_NAME.include?(
|
|
53
|
-
return false if $PROGRAM_NAME.include?(
|
|
54
|
-
return false if ARGV.include?(
|
|
55
|
-
return false if ARGV.include?(
|
|
56
|
-
return false if ARGV.include?(
|
|
52
|
+
return false if $PROGRAM_NAME.include?("rake")
|
|
53
|
+
return false if $PROGRAM_NAME.include?("runner")
|
|
54
|
+
return false if ARGV.include?("console")
|
|
55
|
+
return false if ARGV.include?("runner")
|
|
56
|
+
return false if ARGV.include?("c")
|
|
57
57
|
|
|
58
58
|
# If we made it here, we're likely in server mode
|
|
59
59
|
true
|
|
@@ -89,7 +89,7 @@ Puma::Plugin.create do
|
|
|
89
89
|
# Exponential backoff on error (max 60 seconds)
|
|
90
90
|
# Prevents tight error loops
|
|
91
91
|
backoff_time = [config.parse_interval * 2, 60].min
|
|
92
|
-
$stderr.puts "[SolidLog Puma Plugin] Backing off for #{backoff_time}s" if ENV[
|
|
92
|
+
$stderr.puts "[SolidLog Puma Plugin] Backing off for #{backoff_time}s" if ENV["SOLIDLOG_DEBUG"]
|
|
93
93
|
sleep backoff_time
|
|
94
94
|
end
|
|
95
95
|
end
|
|
@@ -137,15 +137,15 @@ Puma::Plugin.create do
|
|
|
137
137
|
"solid_log_new_entries",
|
|
138
138
|
{ entry_ids: entry_ids }
|
|
139
139
|
)
|
|
140
|
-
$stderr.puts "[SolidLog Puma Plugin] Broadcasted #{entry_ids.size} entries" if ENV[
|
|
140
|
+
$stderr.puts "[SolidLog Puma Plugin] Broadcasted #{entry_ids.size} entries" if ENV["SOLIDLOG_DEBUG"]
|
|
141
141
|
end
|
|
142
142
|
rescue => e
|
|
143
143
|
# Silent failure - broadcasting is optional
|
|
144
|
-
$stderr.puts "[SolidLog Puma Plugin] Broadcast failed: #{e.message}" if ENV[
|
|
144
|
+
$stderr.puts "[SolidLog Puma Plugin] Broadcast failed: #{e.message}" if ENV["SOLIDLOG_DEBUG"]
|
|
145
145
|
end
|
|
146
146
|
|
|
147
147
|
# Log processing stats (directly to STDERR to avoid recursion)
|
|
148
148
|
def log_stats(stats)
|
|
149
|
-
$stderr.puts "[SolidLog Puma Plugin] Processed #{stats[:processed]}, inserted #{stats[:inserted]}, errors #{stats[:errors]}" if ENV[
|
|
149
|
+
$stderr.puts "[SolidLog Puma Plugin] Processed #{stats[:processed]}, inserted #{stats[:inserted]}, errors #{stats[:errors]}" if ENV["SOLIDLOG_DEBUG"]
|
|
150
150
|
end
|
|
151
151
|
end
|
|
@@ -37,7 +37,7 @@ module SolidLog
|
|
|
37
37
|
return stats if raw_entries.empty?
|
|
38
38
|
|
|
39
39
|
# Log to STDERR to avoid recursion (only in debug mode)
|
|
40
|
-
$stderr.puts "[SolidLog::BatchParsingService] Processing #{raw_entries.size} raw entries" if ENV[
|
|
40
|
+
$stderr.puts "[SolidLog::BatchParsingService] Processing #{raw_entries.size} raw entries" if ENV["SOLIDLOG_DEBUG"]
|
|
41
41
|
|
|
42
42
|
# Get promoted fields cache (for performance)
|
|
43
43
|
promoted_fields = get_promoted_fields_cache
|
|
@@ -95,7 +95,7 @@ module SolidLog
|
|
|
95
95
|
Entry.insert_all(entries_to_insert)
|
|
96
96
|
stats[:inserted] = entries_to_insert.size
|
|
97
97
|
# Log to STDERR to avoid recursion (only in debug mode)
|
|
98
|
-
$stderr.puts "[SolidLog::BatchParsingService] Inserted #{entries_to_insert.size} entries" if ENV[
|
|
98
|
+
$stderr.puts "[SolidLog::BatchParsingService] Inserted #{entries_to_insert.size} entries" if ENV["SOLIDLOG_DEBUG"]
|
|
99
99
|
|
|
100
100
|
# Broadcast new entry IDs for live tail
|
|
101
101
|
new_entry_ids = Entry.where(raw_id: raw_ids).pluck(:id)
|
|
@@ -240,7 +240,7 @@ module SolidLog
|
|
|
240
240
|
end
|
|
241
241
|
rescue StandardError => e
|
|
242
242
|
# Silent failure - broadcasting is optional (log to STDERR to avoid recursion)
|
|
243
|
-
$stderr.puts "[SolidLog::BatchParsingService] Broadcast failed: #{e.message}" if ENV[
|
|
243
|
+
$stderr.puts "[SolidLog::BatchParsingService] Broadcast failed: #{e.message}" if ENV["SOLIDLOG_DEBUG"]
|
|
244
244
|
end
|
|
245
245
|
end
|
|
246
246
|
end
|