添加whatshub工单
This commit is contained in:
Regular → Executable
+36
@@ -50,6 +50,42 @@ class SplitSyncConfigService
|
||||
return max(0, (int) $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 单次 cron 最多处理几条到期工单,避免一分钟内打满 Node Browser 槽位
|
||||
*/
|
||||
public static function getMaxTicketsPerCronRun(): int
|
||||
{
|
||||
$value = self::getConfigValue('split_sync_max_per_cron');
|
||||
if ($value === '') {
|
||||
return 2;
|
||||
}
|
||||
return max(1, min(20, (int) $value));
|
||||
}
|
||||
|
||||
/**
|
||||
* 全局 cron 锁过期秒数,防止异常退出后永久占锁
|
||||
*/
|
||||
public static function getCronLockTtlSeconds(): int
|
||||
{
|
||||
$value = self::getConfigValue('split_sync_cron_lock_ttl');
|
||||
if ($value === '') {
|
||||
return 1800;
|
||||
}
|
||||
return max(300, (int) $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Node 排队数达到该阈值时,本轮 cron 不再提交新任务
|
||||
*/
|
||||
public static function getNodeQueueSkipThreshold(): int
|
||||
{
|
||||
$value = self::getConfigValue('split_sync_node_queue_threshold');
|
||||
if ($value === '') {
|
||||
return 2;
|
||||
}
|
||||
return max(0, (int) $value);
|
||||
}
|
||||
|
||||
private static function getConfigValue(string $name): string
|
||||
{
|
||||
$site = Config::get('site.' . $name);
|
||||
|
||||
Reference in New Issue
Block a user