Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maximum Amount of Subscriptions Exceeded (Do I need Quote Increase?) #9

Closed
aucoindan opened this issue May 15, 2020 · 1 comment
Closed

Comments

@aucoindan
Copy link

aucoindan commented May 15, 2020

I am trying to transfer 228 subscriptions to a new account. I created a fresh gcloud account (i.e. no API calls yet). I was only able to transfer 86 accounts before my quota reached. I then created a new account to see if I could transfer any additional (new quota). However, I am reaching the quota before any subscriptions are transferred.

Method name | Requests | Error %
youtube.subscriptions.insert | 397 | 35.77%
youtube.subscriptions.list | 8 | 12.5%

The app is making 13,387 queries in order to transfer these accounts, or 58 queries per subscription.

According to docs - Subscriptions: insert
Quota impact: A call to this method has a quota cost of 50 units in addition to the costs of the specified resource parts.

Knowing that, we probably need to implement some filtering before inserting subscriptions. Because it appears that inserts are happening on subscriptions that have already been transferred.

badRequest (400) | subscriptionDuplicate | The subscription that you are trying to create already exists.

@raj-khare
Copy link
Owner

for (let [id, name] of Object.entries(USER_DATA.oldSubscriptions)) {
    if (!(id in USER_DATA.currentSubscriptions)) {
      // Subscribe the new one
    } else {
      USER_DATA.alreadyInAccount[id] = name;
    }
  }

It appears that the code should only subscribe the new ones. But I'll have a look at why this strange (13,387 queries 🤯) case is happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants