Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update __init__.py #743

Merged
merged 2 commits into from
Oct 31, 2024
Merged

Update __init__.py #743

merged 2 commits into from
Oct 31, 2024

Conversation

JeffAllen714
Copy link
Contributor

Fix: Prevent repeated cron job setup in init.py

Problem:

  • Flask application was attempting to set up cron jobs on every initialization
  • Gunicorn worker reloads caused multiple crontab setup attempts
  • Repeated process creation led to system resource strain and crashes

Changes made:

  1. Added flag file system (.cron_setup_done) to ensure cron setup runs only once
  2. Added error handling for cron setup process to prevent application failures
  3. Fixed crontab syntax to include all required time fields (0 3 * * *)
  4. Added timestamp to flag file for better debugging
  5. Implemented non-blocking error logging

Fix: Prevent repeated cron job setup in __init__.py

Problem:
- Flask application was attempting to set up cron jobs on every initialization
- Gunicorn worker reloads caused multiple crontab setup attempts
- Repeated process creation led to system resource strain and crashes

Changes made:
1. Added flag file system (.cron_setup_done) to ensure cron setup runs only once
2. Added error handling for cron setup process to prevent application failures
3. Fixed crontab syntax to include all required time fields (0 3 * * *)
4. Added timestamp to flag file for better debugging
5. Implemented non-blocking error logging
@Mr615-TN Mr615-TN self-requested a review October 29, 2024 18:26
@Mr615-TN Mr615-TN closed this Oct 29, 2024
@Mr615-TN Mr615-TN reopened this Oct 29, 2024
Copy link
Collaborator

@Mr615-TN Mr615-TN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sah0017 sah0017 merged commit dae235e into master Oct 31, 2024
2 checks passed
@sah0017 sah0017 deleted the JeffAllen714-patch-1 branch October 31, 2024 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants