Skip to content

Commit

Permalink
fix "Can not find Subscriptions: 'bus.cluman.errors'"
Browse files Browse the repository at this point in the history
  • Loading branch information
wayerr authored and vpronto@yandex-team.ru committed Oct 28, 2017
1 parent ff1bc6d commit c49d57f
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import com.codeabovelab.dm.common.security.Action;
import com.codeabovelab.dm.cluman.security.TempAuth;
import com.codeabovelab.dm.common.utils.Closeables;
import com.google.common.collect.ImmutableMap;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -107,6 +108,8 @@ private <T> void addStats(Subscriptions<T> subscriptions, String busId, Function
public void init() {
ThreadFactory tf = new ThreadFactoryBuilder().setDaemon(true).setNameFormat(getClass().getSimpleName() + "-%d").build();
executor = Executors.newCachedThreadPool(tf);
// load system subs, it fix issue: "Can not find Subscriptions: 'bus.cluman.errors'"
subs.set(ImmutableMap.copyOf(systemSubs));
}

@PreDestroy
Expand Down Expand Up @@ -143,6 +146,7 @@ private void load() {
subs.compareAndSet(esuc.getOldMap(), esuc.getNewMap());
//close outdated subscriptions (do not put it in finally block)
esuc.free();
lastUpdate = System.currentTimeMillis();
} finally {
lock.unlock();
}
Expand Down

0 comments on commit c49d57f

Please sign in to comment.