Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ public class TrackerConnectionManager extends FdfsConnectionManager {
@NotNull
private List<String> trackerList = new ArrayList<String>();

/**
* 连接中断以后经过N秒重试,不配置时默认为10分钟
*/
private int retryAfterSecond;

/**
* 构造函数
*/
Expand All @@ -54,6 +59,11 @@ public TrackerConnectionManager(FdfsConnectionPool pool) {
public void initTracker() {
LOGGER.debug("init trackerLocator {}", trackerList);
trackerLocator = new TrackerLocator(trackerList);
if (0 != retryAfterSecond) {
// 如果 retryAfterSecond != 0则,表示开发者自己配置了;set相关对象的属性值
trackerLocator.setRetryAfterSecond(retryAfterSecond);
LOGGER.debug("update trackerLocator retryAfterSecond to [{}]s", retryAfterSecond);
}
}

/**
Expand Down Expand Up @@ -89,4 +99,12 @@ public List<String> getTrackerList() {
public void setTrackerList(List<String> trackerList) {
this.trackerList = trackerList;
}

public int getRetryAfterSecond() {
return retryAfterSecond;
}

public void setRetryAfterSecond(int retryAfterSecond) {
this.retryAfterSecond = retryAfterSecond;
}
}