Fix Google Calendar/Gmail disabled by read-only token mount #72
@@ -25,8 +25,11 @@ class GoogleService:
|
||||
creds = Credentials.from_authorized_user_file(token_path, SCOPES)
|
||||
if creds.expired and creds.refresh_token:
|
||||
creds.refresh(Request())
|
||||
with open(token_path, "w") as f:
|
||||
f.write(creds.to_json())
|
||||
try:
|
||||
with open(token_path, "w") as f:
|
||||
f.write(creds.to_json())
|
||||
except OSError:
|
||||
pass # read-only mount; refreshed creds live in memory
|
||||
self._creds = creds
|
||||
|
||||
self._calendar = build("calendar", "v3", credentials=creds)
|
||||
|
||||
Reference in New Issue
Block a user