Question

So I built an app on App Engine that takes users files and move them to certain folders in the same domain. I made REST api that calls Drive API to list files, rename files, and change permissions etc.

On app load, it fires 4 ajax calls to the server to get name and id of folders and checking if certain folder exists.

The problem is front end ajax calls time out all the time in production. App engine url fetch has 60 sec limit. I used App engine's oauth2 library which uses a different httplib2. So I modified httplib2 source deadline to max 60 sec but it seems to time out after 30 sec. As a result, Drive API calls time out almost every time and app just doesn't work.

I have read the guideline on optimizing drive api calls with partial response and implemented it but didn't see noticeable difference. It's driving me crazy.... please help

Was it helpful?

Solution

You mention "AppEngine's oauth2 library", but then you say "Drive API calls time out". So modifying the Oauth http library won't affect Drive.

Are you using the Google library for your Drive calls, or making direct REST HTTP calls?

If the former, try ...

HttpRequest.setConnectTimeout(55000)

, if the latter just ...

request.getFetchOptions().setDeadline(55d)

NB. Drive is having a brain fart today, so one would hope the underlying problem will go away of its own accord.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top