提交 40866b3e 编写于 作者: O o2sword

collect信息更新同时更新当前运行环境

上级 7cac4d11
......@@ -50,7 +50,7 @@ class ActionRegist extends BaseAction {
Config.collect().setName(name);
Config.collect().setPassword(password);
Config.collect().save();
Config.flush();
this.configFlush(effectivePerson);
/* 人员和应用市场同步 */
ThisApplication.context().scheduleLocal(CollectPerson.class);
ThisApplication.context().scheduleLocal(CollectMarket.class);
......
package com.x.program.center.jaxrs.collect;
import com.x.program.center.ThisApplication;
import com.x.program.center.schedule.CollectMarket;
import com.x.program.center.schedule.CollectPerson;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -42,7 +45,7 @@ class ActionResetPassword extends BaseAction {
if (BooleanUtils.isTrue(wo.getValue())) {
Config.collect().setPassword(password);
Config.collect().save();
Config.flush();
this.configFlush(effectivePerson);
}
result.setData(wo);
return result;
......
......@@ -32,7 +32,7 @@ class ActionUpdate extends BaseAction {
Config.collect().setName(wrapIn.getName());
Config.collect().setPassword(wrapIn.getPassword());
Config.collect().save();
Config.flush();
this.configFlush(effectivePerson);
Wo wo = new Wo();
wo.setValue(true);
result.setData(wo);
......
......@@ -48,7 +48,7 @@ class ActionUpdateUnit extends BaseAction {
Config.collect().setKey(wi.getKey());
Config.collect().setSecret(wi.getSecret());
Config.collect().save();
Config.flush();
this.configFlush(effectivePerson);
}
result.setData(wo);
return result;
......
......@@ -11,12 +11,15 @@ import com.x.base.core.project.bean.WrapCopierFactory;
import com.x.base.core.project.config.Collect;
import com.x.base.core.project.config.Config;
import com.x.base.core.project.connection.ActionResponse;
import com.x.base.core.project.connection.CipherConnectionAction;
import com.x.base.core.project.connection.ConnectionAction;
import com.x.base.core.project.gson.XGsonBuilder;
import com.x.base.core.project.http.ActionResult.Type;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.StandardJaxrsAction;
import com.x.base.core.project.jaxrs.WrapBoolean;
import com.x.base.core.project.tools.DefaultCharset;
import com.x.program.center.ThisApplication;
class BaseAction extends StandardJaxrsAction {
......@@ -124,6 +127,19 @@ class BaseAction extends StandardJaxrsAction {
return resp.getData(ReturnWoBoolean.class).getValue();
}
public void configFlush(EffectivePerson effectivePerson) throws Exception {
Config.flush();
ThisApplication.context().applications().values().forEach(o -> {
o.stream().forEach(app -> {
try {
CipherConnectionAction.get(effectivePerson.getDebugger(), app, "cache", "config", "flush");
} catch (Exception e) {
e.printStackTrace();
}
});
});
}
private static class ReturnWoBoolean extends WrapBoolean {
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册