Pinafore-Web-Client-Frontend/routes/_database/clear.js

10 lines
357 B
JavaScript
Raw Permalink Normal View History

2018-02-09 07:04:10 +01:00
import { accountsCache, clearCache, metaCache, statusesCache } from './cache'
import { deleteDatabase } from './databaseLifecycle'
2018-02-09 07:29:29 +01:00
export async function clearDatabaseForInstance (instanceName) {
2018-02-09 07:04:10 +01:00
clearCache(statusesCache, instanceName)
clearCache(accountsCache, instanceName)
clearCache(metaCache, instanceName)
await deleteDatabase(instanceName)
2018-02-09 07:29:29 +01:00
}