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

低概率挂 #81

Closed
huangyong0301 opened this issue Sep 11, 2017 · 2 comments
Closed

低概率挂 #81

huangyong0301 opened this issue Sep 11, 2017 · 2 comments

Comments

@huangyong0301
Copy link

大神江湖救急:
概率性挂掉
希望能帮忙解决一下

使用了com.hwangjr.rxbus:rxbus:2.0.0后 有时线上用户会出现crash

public class RxBus {
private static Bus sBus;

public RxBus() {
}

public static synchronized Bus get() {
    if(sBus == null) {
        sBus = new Bus(ThreadEnforcer.ANY);
    }

    return sBus;
}

}

post地方

RxBus.get().post(RXTags.UNREAD_COUNT_ADD, ""); //增加一条未读消息

接收的地方
@subscribe(tags = {@tag(RXTags.UNREAD_COUNT_ADD)})
public void setUnreadAdd(String no) {
//查询未读个数
cureFunApi.qryUnReadCount(MyApplication.getInstance().getUserId());
}

tim 20170911193610

@hwangjr
Copy link
Member

hwangjr commented Sep 13, 2017

check 下 com.curefun.tools.e.H(string) 方法的 mapping,看是具体什么类什么方法。看着是你代码里面有使用到反射? 或者最简单处理方式就是:

@subscribe(tags = {@tag(RXTags.UNREAD_COUNT_ADD)})
public void setUnreadAdd(String no) {
    try {
        //查询未读个数
        cureFunApi.qryUnReadCount(MyApplication.getInstance().getUserId());
    catch(Exception e) {
        // exception
    }
}

@hwangjr
Copy link
Member

hwangjr commented Sep 29, 2017

feel free to reopen the issue if you still have problems.

@hwangjr hwangjr closed this as completed Sep 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants