|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Jabe\Engine\Impl\Batch\ExternalTask; |
|
4
|
|
|
|
|
5
|
|
|
use Jabe\Engine\Batch\BatchInterface; |
|
6
|
|
|
use Jabe\Engine\Impl\Batch\{ |
|
7
|
|
|
AbstractBatchJobHandler, |
|
|
|
|
|
|
8
|
|
|
BatchJobConfiguration, |
|
|
|
|
|
|
9
|
|
|
BatchJobContext, |
|
|
|
|
|
|
10
|
|
|
BatchJobDeclaration |
|
|
|
|
|
|
11
|
|
|
}; |
|
12
|
|
|
use Jabe\Engine\Impl\Cmd\{ |
|
13
|
|
|
SetExternalTasksRetriesCmd, |
|
14
|
|
|
UpdateExternalTaskRetriesBuilderImpl |
|
15
|
|
|
}; |
|
16
|
|
|
use Jabe\Engine\Impl\Interceptor\CommandContext; |
|
17
|
|
|
use Jabe\Engine\Impl\JobExecutor\{ |
|
18
|
|
|
JobDeclaration, |
|
19
|
|
|
JobHandlerConfigurationInterface |
|
20
|
|
|
}; |
|
21
|
|
|
use Jabe\Engine\Impl\Persistence\Entity\{ |
|
22
|
|
|
ByteArrayEntity, |
|
23
|
|
|
ExecutionEntity, |
|
24
|
|
|
MessageEntity |
|
25
|
|
|
}; |
|
26
|
|
|
|
|
27
|
|
|
class SetExternalTaskRetriesJobHandler extends AbstractBatchJobHandler |
|
28
|
|
|
{ |
|
29
|
|
|
public static $JOB_DECLARATION; |
|
30
|
|
|
|
|
31
|
|
|
public function getType(): string |
|
32
|
|
|
{ |
|
33
|
|
|
return BatchInterface::TYPE_SET_EXTERNAL_TASK_RETRIES; |
|
34
|
|
|
} |
|
35
|
|
|
|
|
36
|
|
|
public function getJobDeclaration(): JobDeclaration |
|
37
|
|
|
{ |
|
38
|
|
|
if (self::$JOB_DECLARATION == null) { |
|
39
|
|
|
self::$JOB_DECLARATION = new BatchJobDeclaration(BatchInterface::TYPE_SET_EXTERNAL_TASK_RETRIES); |
|
40
|
|
|
} |
|
41
|
|
|
return self::$JOB_DECLARATION; |
|
42
|
|
|
} |
|
43
|
|
|
|
|
44
|
|
|
public function execute(JobHandlerConfigurationInterface $configuration, ExecutionEntity $execution, CommandContext $commandContext, ?string $tenantId): void |
|
45
|
|
|
{ |
|
46
|
|
|
$configurationEntity = $commandContext |
|
47
|
|
|
->getDbEntityManager() |
|
48
|
|
|
->selectById(ByteArrayEntity::class, $configuration->getConfigurationByteArrayId()); |
|
|
|
|
|
|
49
|
|
|
|
|
50
|
|
|
$batchConfiguration = $this->readConfiguration($configurationEntity->getBytes()); |
|
51
|
|
|
|
|
52
|
|
|
$commandContext->executeWithOperationLogPrevented( |
|
53
|
|
|
new SetExternalTasksRetriesCmd( |
|
54
|
|
|
new UpdateExternalTaskRetriesBuilderImpl( |
|
55
|
|
|
$batchConfiguration->getIds(), |
|
56
|
|
|
$batchConfiguration->getRetries() |
|
57
|
|
|
) |
|
58
|
|
|
) |
|
59
|
|
|
); |
|
60
|
|
|
|
|
61
|
|
|
$commandContext->getByteArrayManager()->delete($configurationEntity); |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
protected function createJobConfiguration(SetRetriesBatchConfiguration $configuration, array $processIdsForJob): SetRetriesBatchConfiguration |
|
|
|
|
|
|
65
|
|
|
{ |
|
66
|
|
|
return new SetRetriesBatchConfiguration($processIdsForJob, $configuration->getRetries()); |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
|
|
protected function getJsonConverterInstance(): SetExternalTaskRetriesBatchConfigurationJsonConverter |
|
70
|
|
|
{ |
|
71
|
|
|
return SetExternalTaskRetriesBatchConfigurationJsonConverter::instance(); |
|
72
|
|
|
} |
|
73
|
|
|
} |
|
74
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths