Skip to content

Commit

Permalink
Fixed repair logging
Browse files Browse the repository at this point in the history
  • Loading branch information
westsurname committed Jul 25, 2024
1 parent 2f3d33b commit c9b54b0
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions repair.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import argparse
import time
import traceback
import shared.debrid # Run validation
from shared.arr import Sonarr, Radarr
from shared.discord import discordUpdate, discordError
Expand Down Expand Up @@ -119,9 +120,11 @@ def main():
print("Inconsistent folders:")
[print(parentFolder) for parentFolder in parentFolders]
print()
except Exception as e:
print(f"An error occurred while processing {media.title}: {str(e)}")
discordError(f"[{args.mode}] An error occurred while processing {media.title}", str(e))
except Exception:
e = traceback.format_exc()

print(f"An error occurred while processing {media.title}: {e}")
discordError(f"[{args.mode}] An error occurred while processing {media.title}", e)

print("Repair complete")
discordUpdate(f"[{args.mode}] Repair complete")
Expand All @@ -131,9 +134,11 @@ def main():
try:
main()
time.sleep(runIntervalSeconds)
except Exception as e:
print(f"An error occurred in the main loop: {str(e)}")
discordError(f"[{args.mode}] An error occurred in the main loop", str(e))
except Exception:
e = traceback.format_exc()

print(f"An error occurred in the main loop: {e}")
discordError(f"[{args.mode}] An error occurred in the main loop", e)
time.sleep(runIntervalSeconds) # Still wait before retrying
else:
main()

0 comments on commit c9b54b0

Please sign in to comment.