Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gathering sleeps together and put them in one task #9

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
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 @@ -32,9 +32,6 @@
public class IMBoxTask extends AbstractWebSocketTask {
/** max times for waiting for last messageId.*/
private static final int MAX_INIT_WAIT_COUNT = 5;
/** wait for last messageId fetched.*/
private static final int WAIT_TIME = 5_000;

/** current latest messageId.*/
private String messageId = null;
/** last latest messageID.*/
Expand Down Expand Up @@ -103,14 +100,4 @@ protected Map<String, String> initialParam(final String key) {
}
return param;
}
@Override
protected Map<String, String> deferringParam(final String key) {
final Optional<String> mid = IMBoxMessageIdManager.messageId(key);
if (mid.isPresent())
return DEFERRING_INTERVAL_PARAM;
final Map<String, String> param = new HashMap<>();
param.put("interval", String.valueOf(WAIT_TIME));
param.put("repeate", String.valueOf(1));
return param;
}
}