gwu-libraries / libcal_pp_integration

Development repo for API integration between LibCal and Passage Point
1 stars 0 forks source link

Clear appointment cache daily #9

Open dolsysmith opened 3 years ago

dolsysmith commented 3 years ago

In order to support recurring appointments, we need to clear the appts table on a regular basis. (Recurring appointments from LibCal use the same ID, so the app currently discards any instances of a recurring appointment after the first.)

Proposed implementation:

dolsysmith commented 3 years ago

Need to fix error that occurs at the end of the month:

ValueError: day is out of range for month
Traceback (most recent call last):
  File "/opt/libcal_pp_integration/app.py", line 221, in <module>
    scheduler.enterabs(get_next_midnight(), 2, cleanup, argument=(app, scheduler))
  File "/opt/libcal_pp_integration/app.py", line 200, in get_next_midnight
    midnight = datetime(today.year, today.month, today.day+1, 0, 0, 0).timestamp()