You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/05/18 08:40:55 UTC

[GitHub] [shardingsphere-elasticjob] jbgzz commented on issue #2082: elasticjob-lite v3.0.1 在项目中创建作业后,定时器可以正常调度。但是一旦项目重启后创建的作业就失效了

jbgzz commented on issue #2082:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2082#issuecomment-1129735434

   Create a way:
   
   JobConfiguration jobConfig = JobConfiguration.newBuilder(command.getName(), shardingTotalCount)
   .timeZone("GMT+8")
   .cron(command.getCron())
   .jobParameter(JsonUtils.serialize(parameterMap))
   .monitorExecution(true)
   .failover(true)
   .misfire(true)
   .maxTimeDiffSeconds(60)
   .reconcileIntervalMinutes(1)
   .addExtraConfigurations(new TracingConfiguration("RDB", this.dataSource))
   .description(command.getDescription())
   .jobErrorHandlerType("EMAIL")
   .build();
   setEmailProperties(jobConfig, sysAppid, sysSaleItemKey);
   new ScheduleJobBootstrap(registryCenter, new MySimpleJob(), jobConfig).schedule();
   
   **After the job is created in the project, the timer can be scheduled normally. But once the project restarts, the jobs created are invalidated**


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org