안쓰는 인덱스 제거

This commit is contained in:
2023-08-21 11:01:21 +09:00
parent a8df7d54bd
commit e8832f329a
2 changed files with 5 additions and 20 deletions

View File

@ -318,18 +318,6 @@ func (mg *Maingate) prepare(context context.Context) (err error) {
return err
}
if err = mg.mongoClient.MakeIndices(CollectionWhitelist, map[string]bson.D{
"service": {{Key: "service", Value: 1}},
}); err != nil {
return err
}
if err = mg.mongoClient.MakeIndices(CollectionFile, map[string]bson.D{
"service": {{Key: "service", Value: 1}},
}); err != nil {
return err
}
if err = mg.mongoClient.MakeIndices(CollectionAccount, map[string]bson.D{
"accid": {{Key: "accid", Value: 1}},
}); err != nil {
@ -337,11 +325,12 @@ func (mg *Maingate) prepare(context context.Context) (err error) {
}
if err = mg.mongoClient.MakeUniqueIndices(CollectionFile, map[string]bson.D{
"sk": {{Key: "service", Value: 1}, {Key: "key", Value: 1}},
"keyonly": {{Key: "key", Value: 1}},
}); err != nil {
return err
}
// Delete대신 _ts로 expire시킴. pipeline에 삭제 알려주기 위함
if err = mg.mongoClient.MakeExpireIndex(CollectionWhitelist, 10); err != nil {
return err
}