Skip to content

Commit

Permalink
Update app.py
Browse files Browse the repository at this point in the history
handle busy resources
  • Loading branch information
LucifersCircle committed Dec 7, 2024
1 parent b478a24 commit 50675f0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
# Function to initialize the database if it doesn't exist
def initialize_db():
if os.path.exists(DB_FILE) and not os.path.isfile(DB_FILE):
print(f"Error: {DB_FILE} exists but is not a file. Removing it.")
os.rmdir(DB_FILE) # Remove the directory
print(f"Error: {DB_FILE} exists but is not a file and cannot be removed automatically.")
print("Please remove it manually and restart the application.")
return # Exit initialization to prevent further errors

if not os.path.exists(DB_FILE):
try:
Expand Down

0 comments on commit 50675f0

Please sign in to comment.