From 36f08212a0b07a2d97fe39479a47da87fcce59b7 Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Mon, 27 Jan 2025 19:28:40 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Wired=20the=20kafka=20producer?= =?UTF-8?q?=20back=20up?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/comicprocessor.service.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/services/comicprocessor.service.ts b/services/comicprocessor.service.ts index d23d3a9..2fbbaa5 100644 --- a/services/comicprocessor.service.ts +++ b/services/comicprocessor.service.ts @@ -27,9 +27,9 @@ export default class ComicProcessorService extends Service { // @ts-ignore: schema parameter is required by Service constructor constructor( public broker: ServiceBroker, - schema: ServiceSchema<{}> = { name: "comicProcessor" }, + schema: ServiceSchema = { name: "comicProcessor" }, ) { - super(broker); + super(broker, schema); this.parseServiceSchema({ name: "comicProcessor", methods: { @@ -158,12 +158,12 @@ export default class ComicProcessorService extends Service { /* Match and rank */ - const result = await this.rankSearchResults( + const finalResult = await this.rankSearchResults( this.airDCPPSearchResults, query, ); - console.log(JSON.stringify(result, null, 4)); - console.log("majori"); + console.log("Final result:"); + console.log(JSON.stringify(finalResult, null, 4)); /* Kafka messages need to be in a format that can be serialized to JSON, and a Map is not directly serializable in a way that retains its structure, @@ -173,7 +173,7 @@ export default class ComicProcessorService extends Service { topic: "comic-search-results", messages: [ { - value: JSON.stringify(result), + value: JSON.stringify(finalResult), }, ], }); @@ -186,7 +186,7 @@ export default class ComicProcessorService extends Service { args: [ { query, - result, + finalResult, }, ], });