perf: improve the perf of Anonymous GitHub

This commit is contained in:
tdurieux
2023-02-08 15:34:50 +01:00
parent 2e36b72a7f
commit 5c72f54db5
21 changed files with 529 additions and 215 deletions

View File

@@ -15,7 +15,10 @@ const AnonymizedRepositorySchema = new Schema({
lastView: Date,
pageView: Number,
accessToken: String,
owner: Schema.Types.ObjectId,
owner: {
type: Schema.Types.ObjectId,
index: true,
},
conference: String,
source: {
type: { type: String },

View File

@@ -15,6 +15,8 @@ export let isConnected = false;
export async function connect() {
await mongoose.connect(MONGO_URL + "production", {
authSource: "admin",
appName: "Anonymous GitHub Server",
compressors: "zlib",
} as ConnectOptions);
isConnected = true;