Skip to content

Commit

Permalink
disable cache_discovery
Browse files Browse the repository at this point in the history
to suppress errors in logs:
file_cache is unavailable when using oauth2client >= 4.0.0

googleapis/google-api-python-client#299
googleapis/google-api-python-client#325
  • Loading branch information
b4tman committed Feb 25, 2020
1 parent d146eec commit 5d37aa2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sync_ics2gcal/gcal.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def default():

scopes = ['https://www.googleapis.com/auth/calendar']
credentials, _ = google.auth.default(scopes=scopes)
service = discovery.build('calendar', 'v3', credentials=credentials)
service = discovery.build('calendar', 'v3', credentials=credentials, cache_discovery=False)
return service

@staticmethod
Expand All @@ -40,7 +40,7 @@ def from_srv_acc_file(service_account_file):
scopes = ['https://www.googleapis.com/auth/calendar']
credentials = service_account.Credentials.from_service_account_file(service_account_file)
scoped_credentials = credentials.with_scopes(scopes)
service = discovery.build('calendar', 'v3', credentials=scoped_credentials)
service = discovery.build('calendar', 'v3', credentials=scoped_credentials, cache_discovery=False)
return service

@staticmethod
Expand Down

0 comments on commit 5d37aa2

Please sign in to comment.