liberodark / ODrive

Google Drive GUI for Windows / Mac / Linux
https://liberodark.github.io/ODrive/
GNU General Public License v3.0
1.16k stars 136 forks source link

Limit API Request #99

Open liberodark opened 5 years ago

liberodark commented 5 years ago

Now have new systeme on 0.2.2 for more speed download file but the google api limit that :

 "error": {
  "errors": [
   {
    "domain": "usageLimits",
    "reason": "userRateLimitExceeded",
    "message": "User Rate Limit Exceeded. Rate of requests for user exceed configured project quota. You may consider re-evaluating expected per-user traffic to the API and adjust project quota limits accordingly. You may monitor aggregate quota usage and adjust limits in the API Console: https://console.developers.google.com/apis/api/drive.googleapis.com/quotas?project=985525764653",
    "extendedHelp": "https://console.developers.google.com/apis/api/drive.googleapis.com/quotas?project=985525764653"
   }
  ],
  "code": 403,
  "message": "User Rate Limit Exceeded. Rate of requests for user exceed configured project quota. You may consider re-evaluating expected per-user traffic to the API and adjust project quota limits accordingly. You may monitor aggregate quota usage and adjust limits in the API Console: https://console.developers.google.com/apis/api/drive.googleapis.com/quotas?project=985525764653"
 }
}

Need to limit for 1sec / 10 files

GideonZ commented 5 years ago

I have the same problem. This renders odrive completely unusable, because it creates files with this error in them, rather than trying again at a later time. So it thinks that the file is synced, but it isn't. I don't even want to think about what happens when you 'touch' the file... the file with this error message in it will propagate to all systems.

bobpwei commented 5 years ago

Running into the same issue. Quite a few files have been overwritten with the error messages :(

nophead commented 5 years ago

I have run into this. Is there any workaround or is it simply unusable until fixed?

Files list done!
Files list done!
Files list done!
syncing false
Updated syncing status
Updating tray icon, connected:  true syncing:  false
{ Error: Rate Limit Exceeded
    at Request._callback (/home/chrisp/ODrive/node_modules/google-auth-library/lib/transporters.js:85:15)
    at Request.self.callback (/home/chrisp/ODrive/node_modules/request/request.js:185:22)
    at Request.emit (events.js:182:13)
    at Request.<anonymous> (/home/chrisp/ODrive/node_modules/request/request.js:1161:10)
    at Request.emit (events.js:182:13)
    at IncomingMessage.<anonymous> (/home/chrisp/ODrive/node_modules/request/request.js:1083:12)
    at Object.onceWrapper (events.js:273:13)
    at IncomingMessage.emit (events.js:187:15)
    at endReadableNT (_stream_readable.js:1092:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  code: 403,
  errors:
   [ { domain: 'usageLimits',
       reason: 'rateLimitExceeded',
       message: 'Rate Limit Exceeded' } ] }
nophead commented 5 years ago

I am not a Java programmer but I am a programmer. I found this line https://github.com/liberodark/ODrive/blob/master/app/core/sync.js#L778 and tried increasing the delay to 100. That did not work because more often than not the loop does not run, so I added another delay outside the loop in that case and it works.

Does it really need to be limited to 10 files a second? That is much slower than Google's backup and sync.