@credo-ts/core
Version:
<p align="center"> <br /> <img alt="Credo Logo" src="https://github.com/openwallet-foundation/credo-ts/blob/c7886cb8377ceb8ee4efe8d264211e561a75072d/images/credo-logo.png" height="250px" /> </p> <h1 align="center"><b>Credo - Core</b></h1
31 lines (30 loc) • 1.19 kB
JavaScript
import { InjectionSymbols } from "../../../../constants.mjs";
import { BaseRecord } from "../../../BaseRecord.mjs";
//#region src/storage/migration/updates/0.3.1-0.4/cache.ts
/**
* removes the all cache records as used in 0.3.0, as they have been updated to use the new cache interface.
*/
async function migrateCacheToV0_4(agent) {
agent.config.logger.info("Removing 0.3 cache records from storage");
const storageService = agent.dependencyManager.resolve(InjectionSymbols.StorageService);
agent.config.logger.debug("Fetching all cache records");
const records = await storageService.getAll(agent.context, CacheRecord);
for (const record of records) {
agent.config.logger.debug(`Removing cache record with id ${record.id}`);
await storageService.deleteById(agent.context, CacheRecord, record.id);
agent.config.logger.debug(`Successfully removed cache record with id ${record.id}`);
}
}
var CacheRecord = class CacheRecord extends BaseRecord {
constructor(..._args) {
super(..._args);
this.type = CacheRecord.type;
}
getTags() {
return this._tags;
}
};
CacheRecord.type = "CacheRecord";
//#endregion
export { migrateCacheToV0_4 };
//# sourceMappingURL=cache.mjs.map