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

Function init

src/_provider/metaOverviewAbstract.ts:115–132  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

113 private run = false;
114
115 async init() {
116 if (this.run) return this;
117
118 const cache = this.getCache();
119 if (await cache.hasValueAndIsNotEmpty()) {
120 this.logger.log('Cached');
121 this.meta = await cache.getValue();
122 this.run = true;
123 await this.fillOverviewState();
124 return this;
125 }
126
127 await this._init();
128 this.run = true;
129 await cache.setValue(this.getMeta());
130 await this.fillOverviewState();
131 return this;
132 }
133
134 protected async fillOverviewState() {
135 for (const relation in this.meta.related) {

Callers

nothing calls this directly

Calls 5

hasValueAndIsNotEmptyMethod · 0.80
setValueMethod · 0.80
getCacheMethod · 0.45
getValueMethod · 0.45
_initMethod · 0.45

Tested by

no test coverage detected