Skip to content

Commit 7b5b8a8

Browse files
committed
WIP
1 parent 6ebbdbd commit 7b5b8a8

3 files changed

Lines changed: 38 additions & 1 deletion

File tree

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ implementing `DataflowTypeInterface`.
243243

244244
Otherwise, manually add the tag `coderhapsodie.dataflow.type` in your dataflow type service configuration:
245245

246-
```yaml
247246
```yaml
248247
CodeRhapsodie\DataflowExemple\DataflowType\MyFirstDataflowType:
249248
tags:

src/Command/JobCleanupCommand.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace CodeRhapsodie\DataflowBundle\Command;
6+
7+
use Symfony\Component\Console\Attribute\AsCommand;
8+
use Symfony\Component\Console\Command\Command;
9+
use Symfony\Component\Console\Input\InputInterface;
10+
use Symfony\Component\Console\Output\OutputInterface;
11+
12+
#[AsCommand(name: 'code-rhapsodie:job_cleanup', description: 'Cleanup job history.')]
13+
class JobCleanupCommand extends Command
14+
{
15+
protected function configure()
16+
{
17+
$this->setHelp('Job retention can be configured with the "job_history_retention" configuration.');
18+
}
19+
20+
protected function execute(InputInterface $input, OutputInterface $output): int
21+
{
22+
23+
}
24+
}

src/DependencyInjection/Configuration.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,20 @@ public function getConfigTreeBuilder(): TreeBuilder
5252
->thenInvalid('You need "league/flysystem" to use Dataflow file exception mode.')
5353
->end()
5454
->end()
55+
->arrayNode('job_history')
56+
->addDefaultsIfNotSet()
57+
->children()
58+
->integerNode('retention')
59+
->defaultValue(30)
60+
->min(0)
61+
->info('How many days completed jobs are kept when running the cleanup command.')
62+
->end()
63+
->integerNode('forceful_completion_delay')
64+
->defaultValue(24)
65+
->min(24)
66+
->info('Running jobs will be forcefully set as completed after this many full calendar days when running the cleanup command.')
67+
->end()
68+
->end()
5569
->end()
5670
;
5771

0 commit comments

Comments
 (0)