This commit is contained in:
Yuri Kuznetsov
2020-07-15 23:07:50 +03:00
parent f86a493ba6
commit 17c1070fc1
3 changed files with 25 additions and 17 deletions
+5 -5
View File
@@ -39,17 +39,17 @@ use Espo\Core\{
class Manager
{
protected $config;
protected $fileManager;
protected $entityManager;
protected $fieldManagerUtil;
private $cacheFile = 'data/cache/application/webhooks.php';
protected $skipAttributeList = ['isFollowed', 'modifiedAt', 'modifiedBy'];
private $data = null;
protected $config;
protected $fileManager;
protected $entityManager;
protected $fieldManagerUtil;
public function __construct(
Config $config,
FileManager $fileManager,
+15 -11
View File
@@ -29,10 +29,18 @@
namespace Espo\Core\Webhook;
use Espo\ORM\Entity;
use Espo\Core\Utils\DateTime;
use Espo\Entities\WebhookQueueItem;
use Espo\Entities\Webhook;
use Espo\Entities\{
Webhook,
WebhookQueueItem,
WebhookEventQueueItem,
};
use Espo\Core\{
AclManager,
Utils\Config,
Utils\DateTime,
ORM\EntityManager,
};
class Queue
{
@@ -51,12 +59,8 @@ class Queue
protected $entityManager;
protected $aclManager;
public function __construct(
Sender $sender,
\Espo\Core\Utils\Config $config,
\Espo\ORM\EntityManager $entityManager,
\Espo\Core\AclManager $aclManager
) {
public function __construct(Sender $sender, Config $config, EntityManager $entityManager, AclManager $aclManager)
{
$this->sender = $sender;
$this->config = $config;
$this->entityManager = $entityManager;
@@ -86,7 +90,7 @@ class Queue
}
}
protected function createQueueFromEvent(\Espo\Entities\WebhookEventQueueItem $item)
protected function createQueueFromEvent(WebhookEventQueueItem $item)
{
$webhookList = $this->entityManager->getRepository('Webhook')->where([
'event' => $item->get('event'),
+5 -1
View File
@@ -31,6 +31,10 @@ namespace Espo\Core\Webhook;
use Espo\Entities\Webhook;
use Espo\Core\{
Utils\Config,
};
class Sender
{
const CONNECT_TIMEOUT = 5;
@@ -39,7 +43,7 @@ class Sender
protected $config;
public function __construct(\Espo\Core\Utils\Config $config)
public function __construct(Config $config)
{
$this->config = $config;
}