Reputation: 49150
MAX_WRITE_OPERATIONS_PER_HOUR
in chrome.storage.sync
has value 1,800 (ref). But I want to know how many operations have been done so far in a minute.
I can think of 2 ways either I can keep a count variable maintaining the no. of operations or I can catch the chrome.runtime.lastError
and perform the follow-up operation.
Is there any quick way to find out how many operations have been done so far?
Upvotes: 1
Views: 445
Reputation: 73526
There's no way of reading the internal number of performed/available operations.
It's not even exposed outside the underlying quota counter class in the source code.
Do it manually: maintain a counter or check chrome.runtime.lastError, and postpone writing accordingly via chrome.alarms API (or a simple setTimeout in case you're using a persistent background page).
Upvotes: 1