Skip to content

Commit a8739d2

Browse files
committed
Update time interval
1 parent d1e70c2 commit a8739d2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.symfony.cloud.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ crons:
4444

4545
stale_issues_symfony:
4646
spec: '58 12 * * *'
47-
cmd: croncape bin/console app:issue:ping-stale symfony/symfony
47+
cmd: croncape bin/console app:issue:ping-stale symfony/symfony --not-updated-for 6months
4848

4949
stale_issues_docs:
5050
spec: '48 12 * * *'
51-
cmd: croncape bin/console app:issue:ping-stale symfony/symfony-docs
51+
cmd: croncape bin/console app:issue:ping-stale symfony/symfony-docs --not-updated-for 12months
5252

5353
relationships:
5454
database: "mydatabase:postgresql"

src/Command/PingStaleIssuesCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
*/
2323
class PingStaleIssuesCommand extends Command
2424
{
25-
public const STALE_IF_NOT_UPDATED_SINCE = '-3months';
2625
public const MESSAGE_TWO_AFTER = '+2weeks';
2726
public const MESSAGE_THREE_AND_CLOSE_AFTER = '+2weeks';
2827

@@ -47,6 +46,7 @@ public function __construct(RepositoryProvider $repositoryProvider, IssueApi $is
4746
protected function configure()
4847
{
4948
$this->addArgument('repository', InputArgument::REQUIRED, 'The full name to the repository, eg symfony/symfony-docs');
49+
$this->addOption('not-updated-for', null, InputOption::VALUE_REQUIRED, 'A string representing a time period to for how long the issue has been stalled.', '12months');
5050
$this->addOption('dry-run', null, InputOption::VALUE_NONE, 'Do a test search without making any comments or changes');
5151
}
5252

@@ -61,7 +61,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
6161
return 1;
6262
}
6363

64-
$notUpdatedAfter = new \DateTimeImmutable(self::STALE_IF_NOT_UPDATED_SINCE);
64+
$notUpdatedAfter = new \DateTimeImmutable((string) $input->getOption('not-updated-for'));
6565
$issues = $this->issueApi->findStaleIssues($repository, $notUpdatedAfter);
6666

6767
if ($input->getOption('dry-run')) {

0 commit comments

Comments
 (0)