File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed
components/log-viewer-webui/server/src/fastify-v2/plugins/app/socket/MongoSocketIoServer Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 1+ import { FastifyBaseLogger } from "fastify" ;
12import type {
23 Collection ,
34 Db ,
45} from "mongodb" ;
5- import { FastifyBaseLogger } from "fastify" ;
66
77import { QueryId } from "../../../../../../../common/index.js" ;
88import {
Original file line number Diff line number Diff line change 44// Reference: https://github.com/socketio/socket.io/blob/main/examples/basic-crud-application/server/lib/todo-management/todo.handlers.ts
55
66import {
7+ FastifyBaseLogger ,
78 FastifyInstance ,
89} from "fastify" ;
910import fastifyPlugin from "fastify-plugin" ;
@@ -29,7 +30,6 @@ import {
2930 getQueryHash ,
3031 removeItemFromArray ,
3132} from "./utils.js" ;
32- import { FastifyBaseLogger } from "fastify" ;
3333
3434
3535/**
@@ -79,6 +79,7 @@ class MongoSocketIoServer {
7979 * Creates a new MongoSocketIoServer.
8080 *
8181 * @param fastify
82+ * @throws {Error } When MongoDB database not found
8283 * @return
8384 */
8485 static create (
@@ -205,7 +206,11 @@ class MongoSocketIoServer {
205206 : MongoWatcherCollection {
206207 let watcherCollection = this . #collections. get ( collectionName ) ;
207208 if ( "undefined" === typeof watcherCollection ) {
208- watcherCollection = new MongoWatcherCollection ( collectionName , this . #logger, this . #mongoDb) ;
209+ watcherCollection = new MongoWatcherCollection (
210+ collectionName ,
211+ this . #logger,
212+ this . #mongoDb
213+ ) ;
209214 this . #logger. debug ( `Initialize Mongo watcher collection:${ collectionName } .` ) ;
210215 this . #collections. set ( collectionName , watcherCollection ) ;
211216 }
Original file line number Diff line number Diff line change 33 Filter ,
44} from "mongodb" ;
55
6- import {
7- QueryParameters ,
8- } from "./typings.js" ;
6+ import { QueryParameters } from "./typings.js" ;
97
108
119/**
You can’t perform that action at this time.
0 commit comments