修改定时任务时间
This commit is contained in:
@@ -25,7 +25,7 @@ public class BillingProperties
|
||||
* Keep below Druid maxActive with headroom for other traffic.
|
||||
*/
|
||||
private int localRebillThreads = 16;
|
||||
/** Night window auto-retry of prc_billing_task (all statuses) */
|
||||
/** Hourly auto-retry of prc_billing_task (all statuses) */
|
||||
private NightRetry nightRetry = new NightRetry();
|
||||
private Oracle oracle = new Oracle();
|
||||
|
||||
@@ -120,8 +120,8 @@ public class BillingProperties
|
||||
}
|
||||
|
||||
/**
|
||||
* Overnight rebill window: pull prc_billing_task (all success_status) and retryTask.
|
||||
* Default hours [0, 9) local time; empty result skips billing.
|
||||
* Auto rebill window: pull prc_billing_task (all success_status) and retryTask.
|
||||
* Default hours [0, 24) local time (all day); empty result skips billing.
|
||||
*/
|
||||
public static class NightRetry
|
||||
{
|
||||
@@ -129,8 +129,8 @@ public class BillingProperties
|
||||
private boolean enabled = true;
|
||||
/** Inclusive start hour (0 = 00:00) */
|
||||
private int startHour = 0;
|
||||
/** Exclusive end hour (9 = stop at 09:00) */
|
||||
private int endHour = 9;
|
||||
/** Exclusive end hour (24 = all day) */
|
||||
private int endHour = 24;
|
||||
/** Page size: bill this many then pull next page (default 500) */
|
||||
private int batchSize = 500;
|
||||
|
||||
|
||||
+7
-7
@@ -16,13 +16,13 @@ import com.bms.price.mapper.PrcBillingTaskMapper;
|
||||
import com.bms.price.service.IPrcBillingTaskService;
|
||||
|
||||
/**
|
||||
* 夜间窗口按 prc_billing_task 自动重计费。
|
||||
* Auto retry prc_billing_task on a schedule.
|
||||
*
|
||||
* <p>在 [startHour, endHour) 内(默认 00:00-09:00):最多拉取 {@value #DEFAULT_BATCH}
|
||||
* 条任务 id(不限 success_status)-> 全部计费 -> 立刻拉下一页。
|
||||
* 空页则跳过计费并结束本轮(下次 cron 再处理新数据)。</p>
|
||||
* <p>Within [startHour, endHour) (default all day 00:00-24:00): pull up to {@value #DEFAULT_BATCH}
|
||||
* task ids (any success_status) -> bill all -> pull next page.
|
||||
* Empty page skips billing and ends this tick (next cron handles new rows).</p>
|
||||
*
|
||||
* <p>与监控手工重试 / 条件重试同一条重计费路径(先重置为 WAITING 再处理)。</p>
|
||||
* <p>Same path as monitor manual / filter retry (reset to WAITING then process).</p>
|
||||
*/
|
||||
@Component
|
||||
public class PrcBillingTaskNightRetryTask
|
||||
@@ -52,10 +52,10 @@ public class PrcBillingTaskNightRetryTask
|
||||
private IPrcBillingTaskService billingTaskService;
|
||||
|
||||
/**
|
||||
* Fire every minute; if a previous run is still paging batches, skip.
|
||||
* Fire every hour by default; if a previous run is still paging batches, skip.
|
||||
* Hour gate uses bms.billing.night-retry start/end.
|
||||
*/
|
||||
@Scheduled(cron = "${bms.billing.night-retry.cron:0 0/1 0-8 * * ?}")
|
||||
@Scheduled(cron = "${bms.billing.night-retry.cron:0 0 * * * ?}")
|
||||
public void scheduledTick()
|
||||
{
|
||||
BillingProperties.NightRetry cfg = billingProperties == null ? null : billingProperties.getNightRetry();
|
||||
|
||||
Reference in New Issue
Block a user