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

1.0.18.RELEASE BUG #100

Closed
kinsey-jian opened this issue May 12, 2023 · 4 comments
Closed

1.0.18.RELEASE BUG #100

kinsey-jian opened this issue May 12, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@kinsey-jian
Copy link

新版本:
image
旧版本:
image

新版本导致没有初始化这个
image

@kinsey-jian
Copy link
Author

在调用的时候 父类干的事情:
image
container().getTenantIds() 为空
不会走到这一步
image

@NotFound403
Copy link
Collaborator

@kinsey-jian 有没有异常堆栈信息

@NotFound403 NotFound403 reopened this May 14, 2023
@NotFound403 NotFound403 self-assigned this May 14, 2023
@NotFound403
Copy link
Collaborator

这个确实是一个bug,尝试修改WechatMetaContainer

@AllArgsConstructor
public class WechatMetaContainer {
    private final Map<String, WechatMetaBean> wechatMetaBeanMap = new ConcurrentHashMap<>();
    private final WechatTenantService wechatTenantService;

    /**
     * Add wechat metas.
     *
     * @param wechatMetaBeans the wechat meta beans
     */
    public void addWechatMetas(Collection<WechatMetaBean> wechatMetaBeans) {
        wechatMetaBeans.forEach(this::addMeta);
    }

    private void addMeta(WechatMetaBean wechatMetaBean) {
        String tenantId = wechatMetaBean.getTenantId();
        wechatMetaBeanMap.put(tenantId, wechatMetaBean);
    }
    
    /**
     * Gets wechat meta.
     *
     * @param tenantId the tenantId
     * @return the wechat meta
     */
    public WechatMetaBean getWechatMeta(String tenantId) {
        WechatMetaBean wechatMetaBean = this.wechatMetaBeanMap.get(tenantId);
        if (Objects.nonNull(wechatMetaBean)) {
            return wechatMetaBean;
        } else {
            this.addWechatMetas(wechatTenantService.loadTenants());
            return Objects.requireNonNull(this.wechatMetaBeanMap.get(tenantId),
                    "cant obtain the config with tenant: "+tenantId);
        }
    }

    /**
     * Gets properties keys.
     *
     * @return the properties keys
     */
    public Set<String> getTenantIds() {
        return wechatTenantService.loadTenants()
                .stream()
                .map(WechatMetaBean::getTenantId)
                .collect(Collectors.toSet());
    }
}

@NotFound403
Copy link
Collaborator

1.0.19 已经修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants