Skip to content

Commit

Permalink
Adjust clear timer
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanKingston committed Oct 31, 2023
1 parent 10f7cc9 commit 9bb374d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions shared/js/background/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,9 @@ browserWrapper.createAlarm('clearExpiredHTTPSServiceCache', { periodInMinutes: 6
// Rotate the user agent spoofed
browserWrapper.createAlarm('rotateUserAgent', { periodInMinutes: 24 * 60 })
// Rotate the sessionKey
browserWrapper.createAlarm('rotateSessionKey', { periodInMinutes: 24 * 60 })
browserWrapper.createAlarm('rotateSessionKey', { periodInMinutes: 60 })
// Expire site breakage reports
browserWrapper.createAlarm('clearExpiredBrokenSiteReportTimes', { periodInMinutes: 24 * 60 })
browserWrapper.createAlarm('clearExpiredBrokenSiteReportTimes', { periodInMinutes: 60 })

browser.alarms.onAlarm.addListener(async alarmEvent => {
// Warning: Awaiting in this function doesn't actually wait for the promise to resolve before unblocking the main thread.
Expand Down
3 changes: 3 additions & 0 deletions shared/js/background/startup.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { NewTabTrackerStats } from './newtab-tracker-stats'
import { TrackerStats } from './classes/tracker-stats.js'
import httpsStorage from './storage/https'
import tdsStorage from './storage/tds'
import { clearExpiredBrokenSiteReportTimes } from './broken-site-report'
const utils = require('./utils')
const Companies = require('./companies')
const experiment = require('./experiments')
Expand Down Expand Up @@ -69,6 +70,8 @@ export async function onStartup () {
showContextMenuAction()
}

await clearExpiredBrokenSiteReportTimes()

if (resolveReadyPromise) {
resolveReadyPromise()
resolveReadyPromise = null
Expand Down

0 comments on commit 9bb374d

Please sign in to comment.