添加whatshub工单

This commit is contained in:
root
2026-06-20 04:47:34 +08:00
parent a6c87e8e25
commit d5a0ffa6db
271 changed files with 9377 additions and 303 deletions
+36
View File
@@ -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);