修复工单PHP CLI同步问题 系统设置可以设置并发阈值
This commit is contained in:
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace app\common\service;
|
||||
|
||||
use app\common\library\scrm\AbstractScrmSpider;
|
||||
use app\common\library\scrm\ScrmSpiderInterface;
|
||||
use app\common\library\scrm\spider\A2cSpider;
|
||||
use app\common\library\scrm\spider\ChatknowSpider;
|
||||
@@ -59,6 +60,49 @@ class SplitScrmSpiderFactory
|
||||
return array_keys(self::MAP);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步是否依赖 Node Headless(纯 PHP cURL 等为 false)
|
||||
*/
|
||||
public static function requiresNode(string $ticketType): bool
|
||||
{
|
||||
$class = self::resolveClass($ticketType);
|
||||
if ($class === null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return is_subclass_of($class, AbstractScrmSpider::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<string>
|
||||
*/
|
||||
public static function listDirectSyncTypes(): array
|
||||
{
|
||||
$types = [];
|
||||
foreach (self::listSupportedTypes() as $ticketType) {
|
||||
if (!self::requiresNode($ticketType)) {
|
||||
$types[] = $ticketType;
|
||||
}
|
||||
}
|
||||
|
||||
return $types;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<string>
|
||||
*/
|
||||
public static function listNodeSyncTypes(): array
|
||||
{
|
||||
$types = [];
|
||||
foreach (self::listSupportedTypes() as $ticketType) {
|
||||
if (self::requiresNode($ticketType)) {
|
||||
$types[] = $ticketType;
|
||||
}
|
||||
}
|
||||
|
||||
return $types;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ScrmSpiderInterface|null
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user