aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/server/LocalApi.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/server/LocalApi.js')
-rw-r--r--src/api/server/LocalApi.js20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/api/server/LocalApi.js b/src/api/server/LocalApi.js
index 4b1f03f22..2d5bd8b80 100644
--- a/src/api/server/LocalApi.js
+++ b/src/api/server/LocalApi.js
@@ -2,7 +2,7 @@ import { ipcRenderer } from 'electron';
2import { session } from '@electron/remote'; 2import { session } from '@electron/remote';
3import du from 'du'; 3import du from 'du';
4 4
5import { getServicePartitionsDirectory } from '../../helpers/service-helpers.js'; 5import { getServicePartitionsDirectory } from '../../helpers/service-helpers';
6 6
7const debug = require('debug')('Ferdi:LocalApi'); 7const debug = require('debug')('Ferdi:LocalApi');
8 8
@@ -41,11 +41,23 @@ export default class LocalApi {
41 } 41 }
42 42
43 async clearCache(serviceId = null) { 43 async clearCache(serviceId = null) {
44 const s = serviceId ? session.fromPartition(`persist:service-${serviceId}`) : session.defaultSession; 44 const s = serviceId
45 ? session.fromPartition(`persist:service-${serviceId}`)
46 : session.defaultSession;
45 47
46 debug('LocalApi::clearCache resolves', (serviceId || 'clearAppCache')); 48 debug('LocalApi::clearCache resolves', serviceId || 'clearAppCache');
47 await s.clearStorageData({ 49 await s.clearStorageData({
48 storages: ['appcache', 'cookies', 'filesystem', 'indexdb', 'localstorage', 'shadercache', 'websql', 'serviceworkers', 'cachestorage'], 50 storages: [
51 'appcache',
52 'cookies',
53 'filesystem',
54 'indexdb',
55 'localstorage',
56 'shadercache',
57 'websql',
58 'serviceworkers',
59 'cachestorage',
60 ],
49 quotas: ['temporary', 'persistent', 'syncable'], 61 quotas: ['temporary', 'persistent', 'syncable'],
50 }); 62 });
51 return s.clearCache(); 63 return s.clearCache();