Skip to content

Commit 7b82bd7

Browse files
author
Marco
committed
latest
1 parent c966314 commit 7b82bd7

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

components/log-viewer-webui/server/src/fastify-v2/plugins/app/socket/MongoSocketIoServer/MongoWatcherCollection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import {FastifyBaseLogger} from "fastify";
12
import type {
23
Collection,
34
Db,
45
} from "mongodb";
5-
import {FastifyBaseLogger} from "fastify";
66

77
import {QueryId} from "../../../../../../../common/index.js";
88
import {

components/log-viewer-webui/server/src/fastify-v2/plugins/app/socket/MongoSocketIoServer/index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// Reference: https://github.com/socketio/socket.io/blob/main/examples/basic-crud-application/server/lib/todo-management/todo.handlers.ts
55

66
import {
7+
FastifyBaseLogger,
78
FastifyInstance,
89
} from "fastify";
910
import 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
}

components/log-viewer-webui/server/src/fastify-v2/plugins/app/socket/MongoSocketIoServer/utils.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import {
33
Filter,
44
} from "mongodb";
55

6-
import {
7-
QueryParameters,
8-
} from "./typings.js";
6+
import {QueryParameters} from "./typings.js";
97

108

119
/**

0 commit comments

Comments
 (0)