I'm trying to read a fairly large calendar using almost unchanged code from the official documentation.
from exchangelib import DELEGATE, Account, Credentials, CalendarItem, close_connections
from exchangelib.protocol import BaseProtocol
credentials = Credentials(
username='username',
password='password'
)
account = Account(
primary_smtp_address='address',
credentials=credentials,
autodiscover=True,
access_type=DELEGATE)
a = account
for calendar_item in a.calendar.all():
print('--------------------------')
print(calendar_item.organizer, calendar_item.start)
account.protocol.close()
At the same time, nothing happens at all for the first minute of the script. Then several hundred lines of output are output that I need. After that, the script is stopped by a timeout with the following error: raise self._get_exception(code=response_code, text=msg_text, msg_xml=msg_xml) exchangelib.errors.ErrorTimeoutExpired: The request timed out.
Can I somehow increase the timeout or change the request so that it works faster?