Skip to content

Commit ad5e709

Browse files
committed
chore: Address review comments
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
1 parent b1517d8 commit ad5e709

2 files changed

Lines changed: 1 addition & 41 deletions

File tree

core/Command/TaskProcessing/WorkerCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ protected function configure(): void {
3535
'timeout',
3636
't',
3737
InputOption::VALUE_OPTIONAL,
38-
'Duration in seconds after which the worker exits (0 = run indefinitely)',
38+
'Duration in seconds after which the worker exits (0 = run indefinitely). You should regularly (e.g. every 5 minutes) restart this worker by using this option to make sure it picks up configuration changes.',
3939
0
4040
)
4141
->addOption(

tests/Core/Command/TaskProcessing/WorkerCommandTest.php

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -267,46 +267,6 @@ public function testProcessesCorrectProviderForReturnedTaskType(): void {
267267
$this->assertSame(0, $result);
268268
}
269269

270-
public function testPicksOldestTaskAcrossMultipleEligibleProviders(): void {
271-
$taskTypeId1 = 'type_a';
272-
$taskTypeId2 = 'type_b';
273-
274-
$provider1 = $this->createProvider('provider_a', $taskTypeId1);
275-
$provider2 = $this->createProvider('provider_b', $taskTypeId2);
276-
// getNextScheduledTask returns a type_b task (the globally oldest one)
277-
$task = $this->createTask(3, $taskTypeId2);
278-
279-
$this->manager->expects($this->once())
280-
->method('getProviders')
281-
->willReturn([$provider1, $provider2]);
282-
283-
$this->manager->expects($this->exactly(2))
284-
->method('getPreferredProvider')
285-
->willReturnMap([
286-
[$taskTypeId1, $provider1],
287-
[$taskTypeId2, $provider2],
288-
]);
289-
290-
// Both eligible types are queried together to prevent starvation
291-
$this->manager->expects($this->once())
292-
->method('getNextScheduledTask')
293-
->with($this->equalTo([$taskTypeId1, $taskTypeId2]))
294-
->willReturn($task);
295-
296-
// provider2 must handle the task because the task has type_b
297-
$this->manager->expects($this->once())
298-
->method('processTask')
299-
->with($task, $provider2)
300-
->willReturn(true);
301-
302-
$input = new ArrayInput(['--once' => true], $this->command->getDefinition());
303-
$output = new NullOutput();
304-
305-
$result = $this->command->run($input, $output);
306-
307-
$this->assertSame(0, $result);
308-
}
309-
310270
public function testTaskTypesWhitelistFiltersProviders(): void {
311271
$taskTypeId1 = 'type_a';
312272
$taskTypeId2 = 'type_b';

0 commit comments

Comments
 (0)