|
2 | 2 |
|
3 | 3 | namespace Drupal\os2forms_digital_signature\Service; |
4 | 4 |
|
| 5 | +use Drupal\Component\Datetime\TimeInterface; |
5 | 6 | use Drupal\Core\Config\ConfigFactoryInterface; |
6 | 7 | use Drupal\Core\Config\ImmutableConfig; |
7 | 8 | use Drupal\Core\Entity\EntityStorageInterface; |
@@ -39,6 +40,7 @@ class SigningService { |
39 | 40 |
|
40 | 41 | public function __construct( |
41 | 42 | private readonly ClientInterface $httpClient, |
| 43 | + private readonly TimeInterface $time, |
42 | 44 | ConfigFactoryInterface $configFactory, |
43 | 45 | EntityTypeManager $entityTypeManager, |
44 | 46 | private readonly LoggerChannelInterface $logger, |
@@ -184,7 +186,7 @@ public function deleteStalledSubmissions() : void { |
184 | 186 | $digitalSignatureWebforms = []; |
185 | 187 |
|
186 | 188 | // Finding webforms that have any handler. |
187 | | - $query = \Drupal::entityQuery('webform') |
| 189 | + $query = $this->webformStorage->getQuery() |
188 | 190 | ->exists('handlers'); |
189 | 191 | $handler_webform_ids = $query->execute(); |
190 | 192 |
|
@@ -217,7 +219,7 @@ public function deleteStalledSubmissions() : void { |
217 | 219 |
|
218 | 220 | // Find all stalled webform submissions of digital signature forms. |
219 | 221 | $retention_period = ($this->config->get('os2forms_digital_signature_submission_retention_period')) ?? 300; |
220 | | - $timestamp_threshold = \Drupal::time()->getRequestTime() - $retention_period; |
| 222 | + $timestamp_threshold = $this->time->getRequestTime() - $retention_period; |
221 | 223 | $query = $this->webformSubmissionStorage->getQuery() |
222 | 224 | ->accessCheck(FALSE) |
223 | 225 | ->condition('webform_id', $digitalSignatureWebforms, 'IN') |
|
0 commit comments