Skip to content

Commit

Permalink
refresh token first
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-finley committed Nov 24, 2023
1 parent a4c0b6f commit b1fa7e6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions requeue_failed_files/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@


def run(request):
query = "SELECT desktop_path from dropbox where status = 'pending';"
cursor = mysql_connection.cursor()
cursor.execute(query)
desktop_paths = [row[0] for row in cursor.fetchall()]
cursor.close()

dbx = dropbox.Dropbox(os.getenv("DROPBOX_ACCESS_TOKEN"))

try:
dbx.files_list_folder("")
except dropbox.exceptions.AuthError:
refresh_token()

query = "SELECT desktop_path from dropbox where status = 'pending';"
cursor = mysql_connection.cursor()
cursor.execute(query)
desktop_paths = [row[0] for row in cursor.fetchall()]
cursor.close()

publisher = pubsub_v1.PublisherClient()

futures = []
Expand Down

0 comments on commit b1fa7e6

Please sign in to comment.