Skip to content

v1.0.1-alpha: feat(sync_db): Introduce SQL script execution with timer

Latest
Compare
Choose a tag to compare
@danibritods danibritods released this 29 Aug 06:14
This commit implements an automatic SQL script execution feature triggered by the completion of data insertion. The following enhancements have been made:

1. Added new functions 'run_scripts_after_data_ingestion' and 'execute_scripts_end_timer' to handle the execution of SQL scripts after data ingestion.
2. Introduced a timer mechanism to ensure that SQL scripts are executed after a specific duration of data ingestion.
3. Utilized threading to manage the timer and script execution concurrently.

Upon each 'data_to_db' queue callback, the new mechanism checks if a timer is already running. If not, it initiates the timer, schedules script execution after a specified time interval, and manages the timer's status.

The implementation of this timer-based script execution ensures that SQL scripts for building the 'consulta' and 'demanda' schemas are automatically triggered after the completion of data insertion.