From dad251d02c48b3f4cc2cddca473e208691019e6c Mon Sep 17 00:00:00 2001 From: Jack Darlington Date: Sun, 12 Mar 2017 00:24:53 +0000 Subject: [PATCH] Fix for revoking already expired channel (drive) --- cps/web.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cps/web.py b/cps/web.py index d6019c18..fdf57326 100755 --- a/cps/web.py +++ b/cps/web.py @@ -56,6 +56,8 @@ import io import hashlib import threading +from googleapiclient.errors import HttpError + from tornado import version as tornadoVersion try: @@ -1309,7 +1311,10 @@ def watch_gdrive(): def revoke_watch_gdrive(): last_watch_response=config.config_google_drive_watch_changes_response if last_watch_response: - response=gdriveutils.stopChannel(Gdrive.Instance().drive, last_watch_response['id'], last_watch_response['resourceId']) + try: + 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.config_google_drive_watch_changes_response=None ub.session.merge(settings)