Skip to content

Commit 28b78e6

Browse files
committed
增加成员控制
1 parent d022a05 commit 28b78e6

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

conf/nbs.db

0 Bytes
Binary file not shown.

src/main/java/io/nbs/client/services/IpfsMessageReceiver.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,17 @@ public void startReceiver(){
5858
new Thread(()->{
5959
logger.info("启动消息订阅{}......",worldTopic);
6060
while (ctrlSign){
61-
try {
62-
TimeUnit.MILLISECONDS.sleep(sleepTimes);
63-
} catch (InterruptedException e) {
64-
}
6561
try {
6662
ipfs.pubsub.sub(worldTopic,resList::add,t->t.printStackTrace());
6763
} catch (IOException e) {
6864
logger.error("订阅器异常停止,{}",e.getMessage());
6965
runing = false;
7066
ctrlSign =false;
7167
}
68+
try {
69+
TimeUnit.MILLISECONDS.sleep(sleepTimes);
70+
} catch (InterruptedException e) {
71+
}
7272
}
7373

7474
}).start();
@@ -105,7 +105,7 @@ public void startReceiver(){
105105
* @param jsonMessages
106106
*/
107107
private void proccessMessage(List<String> jsonMessages){
108-
new Thread(()->{
108+
// new Thread(()->{
109109
for(String json: jsonMessages){
110110
logger.info("处理消息....");
111111
StandardIPFSMessage standardIPFSMessage = null;
@@ -124,7 +124,7 @@ private void proccessMessage(List<String> jsonMessages){
124124
continue;
125125
}
126126
if(standardIPFSMessage.getMtype().equals(IPMTypes.nomarl.name())
127-
|| standardIPFSMessage.getMtype().equals(IPMTypes.unkonw)){
127+
|| standardIPFSMessage.getMtype().equals(IPMTypes.unkonw.name())){
128128
if(subscribeListener==null)continue;
129129
MessageItem item = IPMParser.convertMessageItem(standardIPFSMessage);
130130
item.setMessageType(1);
@@ -146,7 +146,7 @@ private void proccessMessage(List<String> jsonMessages){
146146
}
147147
}
148148
}
149-
}).start();
149+
// }).start();
150150
}
151151

152152
public void stopRecived(){

0 commit comments

Comments
 (0)