Skip to content

Commit

Permalink
Merge pull request #324 from scalecube/fix-minor-issue2
Browse files Browse the repository at this point in the history
Fix minor issues
  • Loading branch information
artem-v committed Jun 7, 2020
2 parents ccbc0b2 + c06c87d commit ffd7a28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ private enum MembershipUpdateReason {

// Disposables
private final Disposable.Composite actionsDisposables = Disposables.composite();
private final Disposable.Swap disposable = Disposables.swap();

// Scheduled
private final Scheduler scheduler;
Expand Down Expand Up @@ -293,6 +294,7 @@ private void start0(MonoSink<Object> sink) {
public void stop() {
// Stop accepting requests, events and sending sync
actionsDisposables.dispose();
disposable.dispose();

// Cancel remove members tasks
for (String memberId : suspicionTimeoutTasks.keySet()) {
Expand Down Expand Up @@ -475,7 +477,7 @@ private Optional<Address> selectSyncAddress() {

private void schedulePeriodicSync() {
int syncInterval = membershipConfig.syncInterval();
actionsDisposables.add(
disposable.update(
scheduler.schedulePeriodically(
this::doSync, syncInterval, syncInterval, TimeUnit.MILLISECONDS));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundExcept
for (int i = 0; i < headersSize; i++) {
String name = in.readUTF();
String value = in.readUTF();
headers.put(name, value.equals("null") ? null : value);
headers.put(name, "null".equals(value) ? null : value);
}
this.headers = Collections.unmodifiableMap(headers);
// data
Expand Down

0 comments on commit ffd7a28

Please sign in to comment.