mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-12-03 01:23:31 +01:00
perf: index repository lookups and billing maintenance
This commit is contained in:
1 parent
6a230f73b9
commit
3999a71583
14 files changed
+258
-11
No files matched your search
@@ -11,6 +11,10 @@ import Name from "../core/model/dashboard-name";
|
||||
async function main() {
|
||||
const uri = config.MONGODB_URI || `mongodb://${config.DB_USERNAME}:${config.DB_PASSWORD}@${config.DB_HOSTNAME}:27017/production`;
|
||||
await mongoose.connect(uri, { autoIndex: false, ...(config.MONGODB_URI ? {} : { authSource: "admin" }) });
|
||||
await Repository.collection.createIndex({ billingNeverExpiresUntil: 1, status: 1 }, {
|
||||
name: "billing_never_expiration",
|
||||
partialFilterExpression: { "options.expirationMode": "never", billingNeverExpiresUntil: { $exists: true } },
|
||||
});
|
||||
// Additive only. Never use syncIndexes here, which can drop deployed indexes.
|
||||
await Repository.collection.createIndex({ "coauthors.githubId": 1 });
|
||||
await File.collection.createIndex({ repoId: 1, treeGeneration: 1, path: 1, name: 1 });
|
||||
|
||||
Reference in new issue
Block a user