-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: 解决新增内容时,数据未刷到lucene问题(切面Order顺序问题)
- Loading branch information
1 parent
6a725ed
commit d75683a
Showing
12 changed files
with
125 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,8 @@ | |
import com.upupor.lucene.enums.LuceneDataType; | ||
import com.upupor.lucene.enums.LuceneOperationType; | ||
import lombok.Getter; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.apache.commons.lang3.time.StopWatch; | ||
|
||
import javax.annotation.Resource; | ||
|
||
|
@@ -40,6 +42,7 @@ | |
* @date 2022年04月04日 14:13 | ||
* @email: [email protected] | ||
*/ | ||
@Slf4j | ||
public abstract class AbstractFlush<T> { | ||
|
||
@Getter | ||
|
@@ -80,6 +83,9 @@ protected void update() { | |
public abstract LuceneDataType runDataType(); | ||
|
||
public void flush(LuceneEvent event) { | ||
StopWatch stopWatch = new StopWatch(); | ||
stopWatch.start(); | ||
|
||
// 初始化抽象类基础参数 | ||
this.event = event; | ||
// 初始化目标对象 | ||
|
@@ -96,6 +102,9 @@ public void flush(LuceneEvent event) { | |
if (LuceneOperationType.DELETE.equals(this.event.getOperationType())) { | ||
delete(); | ||
} | ||
|
||
stopWatch.stop(); | ||
log.info("[FlushLucene][操作类型:{}][数据类型:{}][目标Id:{}][耗时:{}ms]",event.getOperationType(),event.getDataType(),event.getTargetId(),stopWatch.getTime()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.