Siddharth-Latthe-07 commented on issue #29857:
URL: https://github.com/apache/superset/issues/29857#issuecomment-2271267839

   possible solutions steps:-
   1. Check the Log Creation Process
   2. Examine the Database Queries:- Review the queries that retrieve the log 
entries for display. Ensure there are no issues like joins or unions that could 
be causing duplicate entries.
   3. Sample snippet:-
   ```
   def log_execution(alert_id, runtime, result):
       # This function should only be called once per execution
       # Ensure there's no duplicate call to this function
       log_entry = {
           'alert_id': alert_id,
           'runtime': runtime,
           'result': result,
       }
       save_log_entry_to_database(log_entry)
   
   # This function might be called at different stages of execution
   # Ensure it’s not causing duplicate log entries
   def execute_alert(alert):
       start_time = get_current_time()
       log_execution(alert.id, start_time, "Started")
   
       result = perform_alert_execution(alert)
   
       end_time = get_current_time()
       log_execution(alert.id, end_time, result)
   ```
   Follow the same for checking the queries 
   Hope this helps, Thanks
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to