Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
tenthreadsstrategy.php
1<?php
2
4
5use Bitrix\Main\Entity\ReferenceField;
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}