CoreCommunity ExtensionsIncubatorDistributionsTYPO3 4.5 ProjectsTYPO3 4.6 ProjectsTYPO3 4.7 ProjectsTYPO3 6.0 ProjectsTYPO3 6.1 ProjectsTYPO3 6.2 Projects (+)

Bug #36593

Scheduler task should not output status messages

Added by Christian Weiske about 1 year ago. Updated 3 months ago.

Status:Resolved Start date:2012-04-26
Priority:Should have Due date:
Assignee:Christian Weiske % Done:

100%

Category:Tests/Operations
Target version:-
Votes: 2 (View)

Description

caretaker's scheduler task outputs status messages like:

--+ Caretaker Root [root] updateAggregatorNode
  |--+ Wichtig [instancegroup_1] updateAggregatorNode
  |  |--+ netresearch.de [instance_3] updateAggregatorNode
  |  |  |--+ Standardtests [instance_3_testgroup_1] updateAggregatorNode
  |  |  |  |--+ ping [instance_3_test_1]
  |  |  |  |  | Ping command took 95.87287902832 milliseconds
  |  |  |  |  +-> OK (updatedTestResult)

This is something the scheduler task should not do. Crontab commands should only display errors, but not have any normal output (cron sends mails for commands that output something).

While I could silence it with > /dev/null, is this something I'd rather not do since normal php errors are also outputted to stdout - and I'd miss them if they occur.

So please silence the caretaker test scheduler task.

History

Updated by Tobias Liebig 6 months ago

  • Status changed from New to Needs Feedback
  • Assignee set to Christian Weiske
  • % Done changed from 0 to 100

I'Ve made a fix in my caretaker fork on github: https://github.com/etobi/caretaker/
Could you check that? If it's ok i can "pull request" it into the official repository.

Updated by Christian Weiske 4 months ago

Your patch only works when the scheduler is run via CLI, not when an extension like scheduler_http runs it.

Please try to find a different way to detect if the task is run via the scheduler.

Updated by Tobias Liebig 4 months ago

Christian Weiske wrote:li

Your patch only works when the scheduler is run via CLI, not when an extension like scheduler_http runs it.

Please try to find a different way to detect if the task is run via the scheduler.

I wasn't aware of "scheduler_http".

Any suggestions how to detect if the CliNotificationService should print something?
What about:

if (!defined('TYPO3_cliKey') || TYPO3_cliKey === '' || TYPO3_cliKey === 'scheduler') return;

Updated by Christian Weiske 3 months ago

Tobias, I'm sorry - scheduler_http does indeed run the scheduler via the cli_dispatch.phpsh script, so the clikey is scheduler - and your patch works.

I nevertheless think that the proper solution would be to unregister the CliNotificationService in class.tx_caretaker_testrunnertask.php, but since it works now, it's fine.

Updated by Christian Weiske 3 months ago

I've made a patch implementing this. Feel free to merge or ignore it: https://github.com/TYPO3-Caretaker/caretaker/pull/2

Updated by Tobias Liebig 3 months ago

  • Status changed from Needs Feedback to Resolved

Also available in: Atom PDF