@@ -571,20 +571,18 @@ impl EventObserver {
571
571
// if the observer is in lossy mode quickly send the payload without checking for the db
572
572
if self . lossy {
573
573
Self :: send_payload_directly ( payload, & full_url, self . timeout , true ) ;
574
- } else {
575
- if let Some ( db_path) = & self . db_path {
576
- let conn =
577
- Connection :: open ( db_path) . expect ( "Failed to open database for event observer" ) ;
574
+ } else if let Some ( db_path) = & self . db_path {
575
+ let conn =
576
+ Connection :: open ( db_path) . expect ( "Failed to open database for event observer" ) ;
578
577
579
- // Insert the new payload into the database
580
- Self :: insert_payload_with_retry ( & conn, & full_url, payload, self . timeout ) ;
578
+ // Insert the new payload into the database
579
+ Self :: insert_payload_with_retry ( & conn, & full_url, payload, self . timeout ) ;
581
580
582
- // Process all pending payloads
583
- Self :: process_pending_payloads ( & conn) ;
584
- } else {
585
- // No database, just send the payload
586
- Self :: send_payload_directly ( payload, & full_url, self . timeout , false ) ;
587
- }
581
+ // Process all pending payloads
582
+ Self :: process_pending_payloads ( & conn) ;
583
+ } else {
584
+ // No database, just send the payload
585
+ Self :: send_payload_directly ( payload, & full_url, self . timeout , false ) ;
588
586
}
589
587
}
590
588
0 commit comments