mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: remove default db connection options
This commit is contained in:
1 file changed
+1
-4
@@ -44,10 +44,7 @@ class MongoService {
|
|||||||
mongourl = mongod.getUri();
|
mongourl = mongod.getUri();
|
||||||
}
|
}
|
||||||
this.opts = opts;
|
this.opts = opts;
|
||||||
this.client = await MongoClient.connect(mongourl, {
|
this.client = await MongoClient.connect(mongourl);
|
||||||
readPreference: 'nearest',
|
|
||||||
writeConcern: new WriteConcern('majority'),
|
|
||||||
});
|
|
||||||
this.db = this.client.db(opts.name || 'hydro');
|
this.db = this.client.db(opts.name || 'hydro');
|
||||||
await bus.parallel('database/connect', this.db);
|
await bus.parallel('database/connect', this.db);
|
||||||
setInterval(() => this.fixExpireAfter(), Time.hour);
|
setInterval(() => this.fixExpireAfter(), Time.hour);
|
||||||
|
|||||||
Reference in new issue
Block a user