No NAME
No NAME

Reputation: 169

Chrome extension "MAX_WRITE_OPERATIONS_PER_MINUTE" error

I use below code:

setInterval(function(){
    chrome.storage.sync.set({'serverTime': "***"}, function() {
        console.log('Settings saved');
    });
}, 50);

After 10 seconds I get below error:

Unchecked runtime.lastError: This request exceeds the MAX_WRITE_OPERATIONS_PER_MINUTE quota.

manifest.json

"permissions": [
    "storage",
    "activeTab",
    "declarativeContent",
    "tabs",
    "unlimitedStorage"
]

Upvotes: 1

Views: 2635

Answers (1)

Zachary Scott
Zachary Scott

Reputation: 56

Look again at your code. The setInterval repeats the code after every 50ms. After 10 seconds you will have sent around 200 calls to the API. Understandably, Google won't accept you clobbering it in this way, hence the quota error. Try increasing the interval time, or better yet, making your calls event based. I don't have enough context for what you are attempting to do, but constantly syncing times is not the intended purpose of storage.sync.

Upvotes: 4

Related Questions