feat: enhance booking process with improved error handling and logging
Added logging to display message when outside booking window in booker.py Added error handling for asyncio.run in crossfit_booker.py Added logging for errors during booking process
This commit is contained in:
@@ -213,6 +213,8 @@ class Booker:
|
||||
# Wait for a short time before next check
|
||||
time.sleep(60)
|
||||
else:
|
||||
# Display message when outside booking window
|
||||
logging.info(f"Not booking now - current time {current_time} is outside the booking window ({target_time} to {booking_window_end})")
|
||||
# Check again in 5 minutes if outside booking window
|
||||
time.sleep(300)
|
||||
except Exception as e:
|
||||
|
||||
@@ -84,7 +84,10 @@ class CrossFitBooker:
|
||||
This method initiates the booking process by running the Booker's main execution loop.
|
||||
"""
|
||||
import asyncio
|
||||
asyncio.run(self.booker.run())
|
||||
try:
|
||||
asyncio.run(self.booker.run())
|
||||
except Exception as e:
|
||||
logging.error(f"Error in booking process: {str(e)}")
|
||||
|
||||
def get_auth_headers(self) -> Dict[str, str]:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user