Skip to content

Commit

Permalink
Disabled multi-threading by default, unnecessary most of the time
Browse files Browse the repository at this point in the history
  • Loading branch information
joobert committed Jun 24, 2024
1 parent 18dc20c commit eb5fb47
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions mitten.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
time.sleep(1)
sys.exit(1)

# Load environment variables from a .env file
# Load environment variables from .env file
load_dotenv()

# Get environment variables and handle missing or empty variables
Expand Down Expand Up @@ -255,12 +255,12 @@ def notify_discord(repo, commit):

# Construct the log message
log_message = (f"Sending message to Discord for new commit in {repo}\n"
f" Commit SHA: {commit_sha}\n"
f" Commit Message: {simple_commit_message}\n"
f" Description: {description_lines[0]}\n")
f" Commit SHA: {commit_sha}\n"
f" Commit Message: {simple_commit_message}\n"
f" Description: {description_lines[0]}\n")
for line in description_lines[1:]:
log_message += f" {line}\n"
log_message += f" Commit URL: {commit_url}"
log_message += f" {line}\n"
log_message += f" Commit URL: {commit_url}"

# Log the message
logging.info(log_message)
Expand Down Expand Up @@ -323,10 +323,10 @@ def monitor_api_usage():

# Main function to orchestrate the checking and notification process
def main():
# Enable multi-threading to check multiple repositories concurrently (Turn this off if you are having issues with notifications or rate limiting)
enable_multi_threading = True
# Enable multi-threading to check multiple repositories concurrently (Set this to 'False' if you are having issues with notifications or rate limiting)
enable_multi_threading = False

logging.info("Starting Mitten (v1.1.5)")
logging.info("Starting Mitten (v1.1.6)")
logging.info(f"Monitoring {len(repos)} repositories: {repos}")
commit_log = load_commit_log()

Expand Down

0 comments on commit eb5fb47

Please sign in to comment.