MCPcopy Create free account
hub / github.com/chainjet/platform / onModuleInit

Function onModuleInit

libs/common/src/base/base.service.ts:42–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40 }
41
42 async onModuleInit() {
43 if (this.enableFullCache) {
44 this.logger.log(`Caching all ${this.model.modelName}s`)
45 const docs = await this.model.find().exec()
46 docs.forEach((doc) => this.docsCache.set(doc.id, doc))
47 this.useFullCache = true
48 this.logger.log(`Cached ${this.docsCache.size} ${this.model.modelName}s`)
49 }
50 }
51
52 async query(query: Query<T>): Promise<T[]> {
53 // if a search was given, include it on the filter

Callers

nothing calls this directly

Calls 2

logMethod · 0.80
setMethod · 0.80

Tested by

no test coverage detected