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

Function initUserProgressScheduler

src/background/releaseProgress.ts:47–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45}
46
47export async function initUserProgressScheduler() {
48 setTimeout(async () => {
49 const progressInterval = await api.settings.getAsync('progressInterval');
50 const progressSyncLast = await api.storage.get('progressSyncLast');
51 if (Date.now() - progressSyncLast < progressInterval * 60 * 1000) {
52 con.log('Progress on time');
53 return;
54 }
55 if (await main()) {
56 api.storage.set('progressSyncLast', Date.now());
57 }
58 }, 30 * 1000);
59}
60
61async function main() {
62 const alive = new KeepAlive();

Callers 1

mainFunction · 0.90

Calls 3

mainFunction · 0.70
getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected