This repository was archived by the owner on Dec 1, 2021. It is now read-only.
File tree 1 file changed +2
-18
lines changed
src/main/java/net/javadiscord/javabot2
1 file changed +2
-18
lines changed Original file line number Diff line number Diff line change @@ -32,22 +32,6 @@ public class Bot {
32
32
*/
33
33
public static HikariDataSource hikariDataSource ;
34
34
35
- /**
36
- * A thread-safe MongoDB client that can be used to interact with MongoDB.
37
- * @deprecated Use the relational data source for all future persistence
38
- * needs; it promotes more organized code that's less prone to failures.
39
- */
40
- @ Deprecated
41
- public static MongoClient mongoClient ;
42
-
43
- /**
44
- * The single Mongo database where all bot data is stored.
45
- * @deprecated Use the relational data source for all future persistence
46
- * needs; it promotes more organized code that's less prone to failures.
47
- */
48
- @ Deprecated
49
- public static MongoDatabase mongoDb ;
50
-
51
35
/**
52
36
* The bot's configuration.
53
37
*/
@@ -101,11 +85,11 @@ private static void initDataSources() {
101
85
throw new IllegalStateException ("Missing required Discord bot token! Please edit config/systems.json to add it, then run again." );
102
86
}
103
87
hikariDataSource = DbHelper .initDataSource (config );
104
- mongoDb = initMongoDatabase ();
105
88
}
106
89
90
+ @ Deprecated
107
91
private static MongoDatabase initMongoDatabase () {
108
- mongoClient = new MongoClient (new MongoClientURI (config .getSystems ().getMongoDatabaseUrl ()));
92
+ var mongoClient = new MongoClient (new MongoClientURI (config .getSystems ().getMongoDatabaseUrl ()));
109
93
var db = mongoClient .getDatabase ("javabot" );
110
94
var warnCollection = db .getCollection ("warn" );
111
95
warnCollection .createIndex (Indexes .ascending ("userId" ), new IndexOptions ().unique (false ));
You can’t perform that action at this time.
0 commit comments