From aef970e8f5effca8b2117aa07ab5e6d1c9546ffa Mon Sep 17 00:00:00 2001 From: gotoeasy Date: Tue, 8 Oct 2024 19:19:36 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A1=AE=E4=BF=9D=E7=B4=A2=E5=BC=95=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F=EF=BC=8C=E5=8F=96=E6=B6=88=E5=A4=9A=E5=8D=8F=E7=A8=8B?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=B4=A2=E5=BC=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- glc/ldb/storage/logdata/logdata_storage.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/glc/ldb/storage/logdata/logdata_storage.go b/glc/ldb/storage/logdata/logdata_storage.go index 904789a..ecbda1f 100644 --- a/glc/ldb/storage/logdata/logdata_storage.go +++ b/glc/ldb/storage/logdata/logdata_storage.go @@ -136,10 +136,11 @@ func (s *LogDataStorage) readyGo() { } s.saveLogData(data) // 保存日志数据 default: - // 空时再生成索引,多协程跑起来加快速度,再来一次单条同步用于判断,有空则生成直到全部完成 - for i := 0; i < conf.GetGoMaxProcessIdx()-1; i++ { - go s.createInvertedIndex() // 多协程跑起来加快速度 - } + // 【确保索引顺序,取消多协程创建索引】 + // // 空时再生成索引,多协程跑起来加快速度,再来一次单条同步用于判断,有空则生成直到全部完成 + // for i := 0; i < conf.GetGoMaxProcessIdx()-1; i++ { + // go s.createInvertedIndex() // 多协程跑起来加快速度 + // } n := s.createInvertedIndex() // 生成反向索引 // 索引生成完成后,等待接收保存日志