Fix for revoking already expired channel (drive)

pull/121/head
Jack Darlington 8 years ago
parent e3a2bd348c
commit dad251d02c

@ -56,6 +56,8 @@ import io
import hashlib import hashlib
import threading import threading
from googleapiclient.errors import HttpError
from tornado import version as tornadoVersion from tornado import version as tornadoVersion
try: try:
@ -1309,7 +1311,10 @@ def watch_gdrive():
def revoke_watch_gdrive(): def revoke_watch_gdrive():
last_watch_response=config.config_google_drive_watch_changes_response last_watch_response=config.config_google_drive_watch_changes_response
if last_watch_response: if last_watch_response:
try:
response=gdriveutils.stopChannel(Gdrive.Instance().drive, last_watch_response['id'], last_watch_response['resourceId']) response=gdriveutils.stopChannel(Gdrive.Instance().drive, last_watch_response['id'], last_watch_response['resourceId'])
except HttpError, e:
pass
settings = ub.session.query(ub.Settings).first() settings = ub.session.query(ub.Settings).first()
settings.config_google_drive_watch_changes_response=None settings.config_google_drive_watch_changes_response=None
ub.session.merge(settings) ub.session.merge(settings)

Loading…
Cancel
Save