Accepts incoming events and correctly parses them into events. GeoLite2 integration complete"
This commit is contained in:
@@ -28,6 +28,15 @@ class ProcessWafEventJob < ApplicationJob
|
||||
# Create the WAF event record
|
||||
event = Event.create_from_waf_payload!(event_id, single_event_data, project)
|
||||
|
||||
# Enrich with geo-location data if missing
|
||||
if event.ip_address.present? && event.country_code.blank?
|
||||
begin
|
||||
event.enrich_geo_location!
|
||||
rescue => e
|
||||
Rails.logger.warn "Failed to enrich geo location for event #{event.id}: #{e.message}"
|
||||
end
|
||||
end
|
||||
|
||||
# Trigger analytics processing
|
||||
ProcessWafAnalyticsJob.perform_later(project_id: project_id, event_id: event.id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user