File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,10 @@ class AlarmManager {
2222 this . ctl = ctl
2323 }
2424
25+ async checkStorage ( ) {
26+ await freeStorageIfNecessary ( )
27+ }
28+
2529 async checkSync ( ) {
2630 const accounts = await BrowserAccountStorage . getAllAccounts ( )
2731 for ( let accountId of accounts ) {
@@ -105,6 +109,7 @@ export default class BrowserController {
105109
106110 // Set up the alarms
107111
112+ browser . alarms . create ( 'checkStorage' , { periodInMinutes : 15 } )
108113 browser . alarms . create ( 'checkSync' , { periodInMinutes : 1 } )
109114 browser . alarms . onAlarm . addListener ( async alarm => {
110115 await this . alarms [ alarm . name ] ( )
@@ -129,7 +134,6 @@ export default class BrowserController {
129134 } ,
130135 [ ]
131136 )
132- freeStorageIfNecessary ( )
133137
134138 // do some cleaning if this is a new version
135139
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ class AlarmManager {
1515 this . ctl = ctl
1616 this . backgroundSyncEnabled = true
1717 setInterval ( ( ) => this . checkSync ( ) , 25 * 1000 )
18+ setInterval ( ( ) => this . checkStorage ( ) , 30 * 1000 )
1819
1920 Network . addListener ( 'networkStatusChange' , status => {
2021 if ( status . connected ) {
@@ -25,6 +26,10 @@ class AlarmManager {
2526 } )
2627 }
2728
29+ async checkStorage ( ) {
30+ await freeStorageIfNecessary ( )
31+ }
32+
2833 async checkSync ( ) {
2934 if ( ! this . backgroundSyncEnabled ) {
3035 return
@@ -93,7 +98,6 @@ export default class NativeController {
9398 } ,
9499 [ ]
95100 )
96- freeStorageIfNecessary ( )
97101
98102 // lock accounts when locking is enabled
99103
You can’t perform that action at this time.
0 commit comments