runCleaner();
});
-chrome.alarms.create(CONSTANTS.CLEANER_ALARM, {
- // First fire 10 minutes from now.
- 'when': Date.now() + (10 * 60 * 1000),
- 'periodInMinutes': 24 * 60
+chrome.alarms.get(CONSTANTS.CLEANER_ALARM, function(a) {
+ if (a)
+ return;
+
+ chrome.alarms.create(CONSTANTS.CLEANER_ALARM, {
+ // First fire 10 minutes from now.
+ 'when': Date.now() + (10 * 60 * 1000),
+ 'periodInMinutes': 24 * 60
+ });
});
chrome.alarms.onAlarm.addListener(function(alarm) {