Skip to content

Commit 6e5dc66

Browse files
committed
fix: skip dupes event check for overflow
1 parent 8c4125e commit 6e5dc66

1 file changed

Lines changed: 31 additions & 25 deletions

File tree

app/Services/Model/Imp/ProcessScheduleEntityLifeCycleEventService.php

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ final class ProcessScheduleEntityLifeCycleEventService
3838

3939
{
4040

41+
const EntityTypesToSkipDupesCheck = [
42+
Presentation::PresentationOverflowEntityType
43+
];
44+
4145
const CacheTTL = 2;
4246
/**
4347
* @var ISummitRepository
@@ -151,35 +155,37 @@ public function process(string $entity_operator, int $summit_id, int $entity_id,
151155
return;
152156
}
153157

154-
$cache_key = sprintf("%s:%s:%s:%s", $summit_id, $entity_id, $entity_type, $entity_operator);
158+
if(!in_array($entity_type, self::EntityTypesToSkipDupesCheck)) {
155159

156-
if ($this->cache_service->exists($cache_key)) {
157-
Log::warning
158-
(
159-
sprintf
160+
$cache_key = sprintf("%s:%s:%s:%s", $summit_id, $entity_id, $entity_type, $entity_operator);
161+
if ($this->cache_service->exists($cache_key)) {
162+
Log::warning
160163
(
161-
"ProcessScheduleEntityLifeCycleEventService::process %s %s %s %s already processed.",
162-
$summit_id,
163-
$entity_id,
164-
$entity_type,
165-
$entity_operator
166-
));
167-
return;
168-
}
164+
sprintf
165+
(
166+
"ProcessScheduleEntityLifeCycleEventService::process %s %s %s %s already processed.",
167+
$summit_id,
168+
$entity_id,
169+
$entity_type,
170+
$entity_operator
171+
));
172+
return;
173+
}
169174

170-
$res = $this->cache_service->addSingleValue($cache_key, $cache_key, self::CacheTTL);
171-
if (!$res) {
172-
Log::warning
173-
(
174-
sprintf
175+
$res = $this->cache_service->addSingleValue($cache_key, $cache_key, self::CacheTTL);
176+
if (!$res) {
177+
Log::warning
175178
(
176-
"ProcessScheduleEntityLifeCycleEventService::process %s %s %s %s can not add value to cache ( already exists ).",
177-
$summit_id,
178-
$entity_id,
179-
$entity_type,
180-
$entity_operator
181-
));
182-
return;
179+
sprintf
180+
(
181+
"ProcessScheduleEntityLifeCycleEventService::process %s %s %s %s can not add value to cache ( already exists ).",
182+
$summit_id,
183+
$entity_id,
184+
$entity_type,
185+
$entity_operator
186+
));
187+
return;
188+
}
183189
}
184190

185191
if ($entity_type === 'PresentationSpeaker') {

0 commit comments

Comments
 (0)