mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core: db.fixExpireAfter: ignore system collection
This commit is contained in:
1 file changed
+2
@@ -74,7 +74,9 @@ export class MongoService extends Service {
|
||||
public async fixExpireAfter() {
|
||||
// Sometimes mongo's expireAfterSeconds is not working in non-replica set mode;
|
||||
const collections = await this.db.listCollections().toArray();
|
||||
const ignore = ['system.profile', 'system.users', 'system.version', 'system.views'];
|
||||
for (const c of collections) {
|
||||
if (ignore.includes(c.name)) continue;
|
||||
const coll = this.db.collection(c.name);
|
||||
const indexes = await coll.listIndexes().toArray();
|
||||
for (const i of indexes) {
|
||||
|
||||
Reference in new issue
Block a user