1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
tenthreadsstrategy.php
См. документацию.
1<?php
2
3namespace Bitrix\Sender\Posting\ThreadStrategy;
4
5use Bitrix\Main\Entity\ReferenceField;
6use Bitrix\Main\ORM\Fields\ExpressionField;
7use Bitrix\Sender\Internals\Model\PostingThreadTable;
8use Bitrix\Sender\PostingRecipientTable;
9
11{
12 public const THREADS_COUNT = 10;
13
14 protected function setFilter(): void
15 {
16 parent::setFilter();
17 $this->filter += [
18 '=POSTING_ID' => $this->postingId,
20 '=LAST_DIGIT' => $this->threadId,
21 ];
22 }
23
24 protected function setRuntime(): void
25 {
26 $this->runtime = [
27 new ReferenceField(
28 'MAILING_SUB', 'Bitrix\\Sender\\MailingSubscriptionTable', [
29 '=this.CONTACT_ID' => 'ref.CONTACT_ID',
30 '=this.POSTING.MAILING_ID' => 'ref.MAILING_ID'
31 ], ['join_type' => 'LEFT']
32 ),
34 'LAST_DIGIT', 'RIGHT(sender_posting_recipient.ID,1)'
35 )
36 ];
37 }
38
43 public function isProcessLimited(): bool
44 {
45 $maxParallelExecutions = \COption::GetOptionInt(
46 "sender",
47 "max_parallel_threads",
48 10
49 );
50
51 $count = PostingThreadTable::getCount(
52 [
54 ]
55 );
56
57 return $count > $maxParallelExecutions;
58 }
59}
$count
Определения admin_tab.php:4
const SEND_RESULT_WAIT_ACCEPT
Определения posting.php:675
const SEND_RESULT_NONE
Определения posting.php:670