disable cache_discovery

to suppress errors in logs:
file_cache is unavailable when using oauth2client >= 4.0.0

https://github.com/googleapis/google-api-python-client/issues/299
https://github.com/googleapis/google-api-python-client/issues/325
This commit is contained in:
Dmitry Belyaev 2020-02-25 22:43:45 +03:00
parent d146eec7ae
commit 5d37aa2a33
Signed by: b4tman
GPG Key ID: 41A00BF15EA7E5F3
1 changed files with 2 additions and 2 deletions

View File

@ -26,7 +26,7 @@ class GoogleCalendarService():
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
@ -40,7 +40,7 @@ class GoogleCalendarService():
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