usdt-ui在全局配置那边显示执行器的可用状态显示,需要定期去检查,如果不在线,则只能通过输入配置密码,如果下线了又重新上线需要重新启用执行器功能。
This commit is contained in:
1 parent
637be83684
commit
f3f4a306e5
6 files changed
+202
-7
No files matched your search
@@ -0,0 +1,36 @@
|
||||
package com.ruoyi.system.chain;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.jdbc.datasource.DriverManagerDataSource;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/** 运行闩锁持久化测试:故障只能关闭,恢复必须显式由管理员重新开启。 */
|
||||
public class ChainExecutorRuntimeStateTest {
|
||||
private ChainExecutorRuntimeState state;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
JdbcTemplate jdbc = new JdbcTemplate(new DriverManagerDataSource(
|
||||
"jdbc:h2:mem:executor-state" + System.nanoTime()
|
||||
+ ";MODE=MySQL;DATABASE_TO_UPPER=false;DB_CLOSE_DELAY=-1", "sa", ""));
|
||||
jdbc.execute("create table sys_config(config_id bigint auto_increment primary key,config_name varchar(100),"
|
||||
+ "config_key varchar(100),config_value varchar(500),config_type char(1),create_by varchar(64),"
|
||||
+ "create_time timestamp,update_by varchar(64),update_time timestamp,remark varchar(500))");
|
||||
state = new ChainExecutorRuntimeState(jdbc);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void defaultsEnabledThenRequiresExplicitAdministratorEnableAfterOutage() {
|
||||
assertTrue(state.enabled());
|
||||
state.disableAfterOutage();
|
||||
assertFalse(state.enabled());
|
||||
state.disableAfterOutage();
|
||||
assertFalse(state.enabled());
|
||||
state.enableByAdministrator("admin");
|
||||
assertTrue(state.enabled());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user