1
1
import { DatabaseDriver } from './database-driver' ;
2
2
import { MongoDatabase } from "./mongo" ;
3
+ import { Logger } from "../log/logger" ;
3
4
4
5
/**
5
6
* Class that controls the key/value data store.
@@ -13,8 +14,8 @@ export class Database implements DatabaseDriver {
13
14
/**
14
15
* Create a new Mongo database instance.
15
16
*/
16
- constructor ( private options : any ) {
17
- this . driver = new MongoDatabase ( this . options ) ;
17
+ constructor ( private options : any , protected log : Logger ) {
18
+ this . driver = new MongoDatabase ( this . options , this . log ) ;
18
19
}
19
20
20
21
@@ -45,4 +46,16 @@ export class Database implements DatabaseDriver {
45
46
removeInactive ( channel : string , member : any ) : Promise < any > {
46
47
return this . driver . removeInactive ( channel , member ) ;
47
48
}
49
+
50
+ removeInactiveSocketsInThisServer ( collection : string , sockets : any ) : Promise < any > {
51
+ return this . driver . removeInactiveSocketsInThisServer ( collection , sockets ) ;
52
+ }
53
+
54
+ setUserInServer ( collection : string , user : any ) : void {
55
+ return this . driver . setUserInServer ( collection , user ) ;
56
+ } ;
57
+
58
+ delUserInServerBySocketId ( collection : string , socket_id : any ) : void {
59
+ return this . driver . delUserInServerBySocketId ( collection , socket_id ) ;
60
+ }
48
61
}
0 commit comments