From fbf423dfdf9bbbe9936ce4a97345cb8e1987a839 Mon Sep 17 00:00:00 2001 From: Md Bayazid Bostame Date: Wed, 9 Oct 2024 10:57:15 +0200 Subject: [PATCH] minor bug fixes --- main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index bc8e9ed..f27ce0c 100644 --- a/main.py +++ b/main.py @@ -19,6 +19,10 @@ import re # Load environment variables from .env file load_dotenv(dotenv_path=Path(__file__).parent / 'env' / '.env') +# Load the sync interval from the environment or set a default (in seconds) +SYNC_INTERVAL = int(os.getenv('SYNC_INTERVAL', 60)) # Default is 60 seconds + + # Retrieve secret credentials and directories from environment variables IMAP_SERVER = os.getenv('IMAP_SERVER') SMTP_SERVER = os.getenv('SMTP_SERVER') @@ -273,4 +277,4 @@ def countdown_timer(seconds): # Continuously check for new emails every 30 seconds while True: check_email_for_csv() - countdown_timer(30) + countdown_timer(SYNC_INTERVAL)