계정 제재 동작 오류 수정

This commit is contained in:
2023-08-23 17:48:47 +09:00
parent 197ee7127b
commit 184675a9b7
6 changed files with 75 additions and 13 deletions

View File

@ -340,10 +340,10 @@ func (mg *Maingate) prepare(context context.Context) (err error) {
return err
}
if err = mg.mongoClient.MakeUniqueIndices(CollectionBlock, map[string]bson.D{
"codeaccid": {{Key: "code", Value: 1}, {Key: "accid", Value: 1}},
}); err != nil {
return err
if *devflag {
if err = mg.mongoClient.DropIndex(CollectionBlock, "codeaccid"); err != nil {
return err
}
}
if err = mg.mongoClient.MakeExpireIndex(CollectionBlock, int32(3)); err != nil {
@ -417,7 +417,7 @@ func (mg *Maingate) prepare(context context.Context) (err error) {
mg.wl.init(whites)
var blocks []*blockinfo
if err := mg.mongoClient.AllAs(CollectionBlock, &blocks, options.Find().SetReturnKey(false)); err != nil {
if err := mg.mongoClient.AllAs(CollectionBlock, &blocks); err != nil {
return err
}
mg.bl.init(blocks)