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

Fixed bug #159

Merged
merged 9 commits into from
Sep 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public class TaskConstant {
*/
public static final String BROADCAST_NAME = "BROADCAST";

/**
* Broadcast post task name
*/
public static final String BROADCAST_POST_NAME = "BROADCAST_POST";

/**
* Sharding task name
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ private void validAndInitJob(AddJobRequest request) {
} else if (TimeExpressionTypeEnum.isSecondDelay(request.getTimeExpressionType())) {
// Second delay
long delay = Optional.ofNullable(request.getTimeExpressionValue()).orElse(0L);
if (delay <= 0 || delay > 60) {
if (delay <= 0 || delay > TimeUnit.MINUTES.toSeconds(1)) {
CodeEnum.JOB_SECOND_DELAY_INTERVAL_INVALID.throwException();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void setFinish(Boolean finish) {
/**
* Fail sleep
*/
protected void failSleep(){
protected void failSleep() {
try {
Thread.sleep(2000L);
} catch (InterruptedException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@ server.port=${SERVER_PORT:8080}
### admin config
# user passwd hash salt
openjob.admin.user.passwd-salt=${OJ_ADMIN_USER_PWD_SALT:3TJPjpUanNqZ0N1}
# i18n
spring.messages.basename=messages.message
spring.messages.use-code-as-default-message=true
### spring config
spring.jackson.serialization.FAIL_ON_EMPTY_BEANS=false
spring.datasource.driver-class-name=${OJ_DS_DRIVER_CLASS:com.mysql.cj.jdbc.Driver}
spring.datasource.url=${OJ_DS_URL:jdbc:mysql://127.0.0.1:3306/openjob?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai}
spring.datasource.driver-class-name=${OJ_DS_DRIVER_CLASS:org.h2.Driver}
spring.datasource.url=${OJ_DS_URL:jdbc:h2:mem:openjob;MODE=MySQL;DB_CLOSE_DELAY=-1;DATABASE_TO_LOWER=true}
spring.datasource.username=${OJ_DS_USERNAME:root}
spring.datasource.password=${OJ_DS_PASSWORD:123456}
spring.h2.console.enabled=true
spring.h2.console.path=/h2
spring.h2.console.settings.trace=true
spring.h2.console.settings.web-allow-others=true
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.minimum-idle=${OJ_DS_HK_MINI_IDLE:1}
spring.datasource.hikari.maximum-pool-size=${OJ_DS_HK_MAX_POOL_SIZE:10}
Expand All @@ -17,13 +24,13 @@ spring.datasource.hikari.pool-name=${OJ_DS_HK_POOL_NAME:openjob}
spring.jpa.open-in-view=false
spring.flyway.enabled=true
spring.flyway.clean-disabled=true
spring.flyway.locations=${OJ_FW_LOCATIONS:classpath:db/migration/mysql}
spring.flyway.locations=${OJ_FW_LOCATIONS:classpath:db/migration/h2}
spring.flyway.baseline-on-migrate=true
spring.flyway.table=${OJ_FW_TABLE:migration_version}
spring.flyway.baseline-version=0
spring.flyway.encoding=UTF-8
spring.flyway.validate-on-migrate=false
openjob.log.storage.selector=${OJ_LOG_STORAGE_SELECTOR:mysql}
openjob.log.storage.selector=${OJ_LOG_STORAGE_SELECTOR:h2}
# h2
openjob.log.storage.h2.properties.user=${OJ_LOG_STORAGE_H2_USER:root}
openjob.log.storage.h2.properties.password=${OJ_LOG_STORAGE_H2_PASSWORD:123456}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
server.port=${SERVER_PORT:8080}
spring.profiles.active=mysql
#spring.profiles.active=mysql
#spring.profiles.active=pgsql
#spring.profiles.active=oracle
#spring.profiles.active=tidb
Expand Down Expand Up @@ -58,7 +58,7 @@ openjob.log.storage.elasticsearch7.password=${OJ_LOG_STORAGE_ES7_PASSWORD:}
openjob.log.storage.elasticsearch7.cluster-nodes=${OJ_LOG_STORAGE_ES7_CLUSTER_NODES:localhost:9200}
openjob.log.storage.elasticsearch7.index=${OJ_LOG_STORAGE_ES7_INDEX:openjob}
openjob.log.storage.elasticsearch7.socket-timeout=${OJ_LOG_STORAGE_ES7_SOCKET_TIMEOUT:3000}
openjob.scheduler.delay.enable=${OJ_SCHEDULER_DELAY_ENABLE:true}
openjob.scheduler.delay.enable=${OJ_SCHEDULER_DELAY_ENABLE:false}
#spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration
spring.redis.host=${OJ_REDIS_HOST:127.0.0.1}
spring.redis.password=${OJ_REDIS_PASSWORD:}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ ${AnsiColor.GREEN}
:: Website :: https://openjob.io
:: Author :: https://github.com/stelin
:: Github :: https://github.com/open-job/openjob

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
-- ----------------------------
-- Table structure for job_instance
-- ----------------------------
ALTER TABLE "job_instance" ADD "dispatch_version" NUMBER(32);
ALTER TABLE "job_instance" ADD "execute_once" NUMBER(2);

-- ----------------------------
-- Table structure for job_instance_task
-- ----------------------------
ALTER TABLE "job_instance_task" ADD "dispatch_version" NUMBER(32);

-- ----------------------------
-- COMMENT
-- ----------------------------
COMMENT ON COLUMN "job_instance"."dispatch_version" IS 'Dispatch version';

COMMENT ON COLUMN "job_instance"."execute_once" IS 'Execute once, 1=yes 2=no';

COMMENT ON COLUMN "job_instance_task"."dispatch_version" IS 'Dispatch version';

-- ----------------------------
-- UPDATE
-- ----------------------------
UPDATE "job_instance" SET "dispatch_version" = 0, "execute_once" = 2;
UPDATE "job_instance_task" SET "dispatch_version" = 0;
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-- ----------------------------
-- Table structure for job_instance
-- ----------------------------
ALTER TABLE "job_instance"
ADD COLUMN "dispatch_version" numeric(20,0);
ALTER TABLE "job_instance"
ADD COLUMN "execute_once" int2;

COMMENT ON COLUMN "job_instance"."dispatch_version" IS 'Dispatch version';
COMMENT ON COLUMN "job_instance"."execute_once" IS 'Execute once, 1=yes 2=no';

UPDATE "job_instance" SET "dispatch_version" = 0, "execute_once" = 2;
-- ----------------------------
-- Table structure for job_instance_task
-- ----------------------------
ALTER TABLE "job_instance_task"
ADD COLUMN "dispatch_version" numeric(20,0);

COMMENT ON COLUMN "job_instance_task"."dispatch_version" IS 'Dispatch version';

UPDATE "job_instance_task" SET "dispatch_version" = 0;

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading