Skip to content

Commit

Permalink
Change the magic value (2000) to a constant (NOT_FOUND_FLAG_VALID_TIME)
Browse files Browse the repository at this point in the history
  • Loading branch information
guyinyou committed Aug 2, 2021
1 parent 06864ae commit 6619d33
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -30,14 +30,15 @@ public class TopicPublishInfo {
private volatile ThreadLocalIndex sendWhichQueue = new ThreadLocalIndex();
private TopicRouteData topicRouteData;
private long notFoundFlag = -1;
private static final int NOT_FOUND_FLAG_VALID_TIME = 2000;

public void setNotFoundFlag() {
if (!checkNotFoundFlag()) {
notFoundFlag = System.currentTimeMillis();
}
}

public boolean checkNotFoundFlag() { return System.currentTimeMillis() < notFoundFlag + 2000; }
public boolean checkNotFoundFlag() { return System.currentTimeMillis() < notFoundFlag + NOT_FOUND_FLAG_VALID_TIME; }

public boolean isOrderTopic() {
return orderTopic;
Expand Down

0 comments on commit 6619d33

Please sign in to comment.