MCPcopy Index your code
hub / github.com/MALSync/MALSync / indexUpdate

Function indexUpdate

src/background/database.ts:53–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

51}
52
53export async function indexUpdate() {
54 const types = ['anime', 'manga'];
55 const globalMode = await api.settings.getAsync('syncMode');
56 for (let i = 0; i < types.length; i++) {
57 const type = types[i] as 'anime' | 'manga';
58 const state = (await getKey(`update_${type}`)) as number;
59 const mode = await getKey(`update_mode_${type}`);
60
61 if (!state || state < Date.now() - UPDATE_INTERVAL || mode !== globalMode) {
62 await importList(type);
63 }
64 }
65}
66
67export async function getKey(key: string): Promise<string | number | undefined> {
68 return db

Callers 2

initDatabaseFunction · 0.85
databaseRequestFunction · 0.85

Calls 2

getKeyFunction · 0.70
importListFunction · 0.70

Tested by

no test coverage detected