application.yaml 3.5 KB
server:
  port: 8011

dispatch:
  cron:
    expr: 0 */30 8-23 * * ?
    next-day-limit: 20

scheduler:
  init-engineer-capacity:
    # 每天22点1次
    cron-expr: 0 0 22 * * ?
    day-offset-begin: 1
    day-offset-end: 20
    rewrite-force: true

  calc-engineer-capacity:
    # 8-20点,每30分钟1次
    cron-expr: 0 */30 1-23 * * ?
    day-offset-begin: 0
    day-offset-end: 20

  calc-org-capacity:
    # 8-20点,每小时1次
    cron-expr: 0 0 1-23 * * ?
    day-offset-begin: 0
    day-offset-end: 20

spring:
  application:
    name: project-dispatch
    jackson:
      default-property-inclusion: NON_NULL
      #    time-zone: GMT+8
      date-format: yyyy-MM-dd HH:mm:ss
  cloud:
    nacos:
      discovery:
        server-addr: nacos-server:8848
        group: project
      config:
        server-addr: nacos-server:8848
        group: project
        file-extension: yaml
        import-check:
          # no config file
          enabled: false
  config:
    import:
      - nacos:redis-config.yaml?group=project&refreshEnabled=true
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://10.10.0.116:32306/saas_aftersale_test?serverTimezone=Asia/Shanghai
    username: boxi
    password: boxi_dev_0725
    type: com.alibaba.druid.pool.DruidDataSource

  # quartz 配置
  quartz:
    # 应用关闭时,是否等待定时任务执行完成。默认为 false,建议设置为 true
    wait-for-jobs-to-complete-on-shutdown: true
    # 是否覆盖已有 Job 的配置,注意为false时,修改已存在的任务调度cron,周期不生效
    overwrite-existing-jobs: true
    #相关属性配置
    properties:
      org:
        quartz:
          scheduler:
            #调度标识名 集群中每一个实例都必须使用相同的名称
            instanceName: Scheduler
            #ID设置为自动获取 每一个必须不同
            instanceId: AUTO
            makeSchedulerThreadDaemon: false
          jobStore:
            #class: org.quartz.impl.jdbcjobstore.JobStoreTX
            #spring-boot-starter-quartz V2.5.7及以上
            class: org.springframework.scheduling.quartz.LocalDataSourceJobStore
            driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
            #表的前缀,默认QRTZ_
            tablePrefix: QRTZ_
            #是否加入集群
            isClustered: true
            #调度实例失效的检查时间间隔
            clusterCheckinInterval: 10000
            useProperties: false
            #设置调度引擎对触发器超时的忍耐时间 (单位毫秒),60分钟
            misfireThreshold: 3600000
          threadPool:
            class: org.quartz.simpl.SimpleThreadPool
            # 指定在线程池里面创建的线程是否是守护线程
            makeThreadsDaemons: false
            #指定线程数,至少为1(无默认值,一般设置为1-100)
            threadCount: 10
            #设置线程的优先级(最大为java.lang.Thread.MAX_PRIORITY 10,最小为Thread.MIN_PRIORITY 1,默认为5)
            threadPriority: 5
            threadsInheritContextClassLoaderOfInitializingThread: true
    #数据库方式
    job-store-type: jdbc
    #初始化表结构,初始化:always,再次重启改为 embedded
    jdbc:
      initialize-schema: embedded

#seata:
#  application-id: ${spring.application.name}
#  tx-service-group: ${spring.application.name}-group
#  service:
#    vgroup-mapping:
#      project-dispatch-group: default
#    grouplist:
#      default: seata-server:8091