New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add logging to ArchivePurger service, task + Scheduler class & modify CronArchive so scheduled Task logs are displayed. #7602
Conversation
…heduled tasks + Scheduler, modify CronArchive to run scheduled tasks within same process as core:archive so logs are visible in core:archive output.
Remembered the CronArchive method is used within tracker, need to revise how tracker runs scheduled tasks. |
I'm wondering, do we have a test case for this? if not, it would be useful to add one 👍 |
} | ||
return $deletedCount; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind adding an integration test for this? Would be nice to have a test for this. Not only for the return value but also whether it actually deletes the archives.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modified the existing ArchivePurgerTest to test for deleted row counts.
Nice! Do those kinda changes affect performance in any way? |
…cheduled tasks through tracker including test that ensures tracker won't fail if scheduled tasks fail, allow tests to override container config by setting a property in the testing environment file, and properly use TestingEnvironment in RequestCommand.
… logic in ArchivePurger.
… logs at INFO level.
…rger doesn't log anything unless verbose output is requested.
@tsteur Re: performance, I tested using a dump of demo2's DB (which admittedly wouldn't have too much to purge) and there was no discernible difference w/ logging added. |
…getting superuser token auth.
…ommand for tests.
Ready for another review, and then possibly merge. Now includes system test to ensure scheduled tasks are run via tracker correctly and w/o failing the tracker. |
Conflicts: core/CronArchive.php
Conflicts: tests/UI/expected-ui-screenshots
I have checked out the branch and given it a try, the amount of output when running the scheduled tasks is quite high. For example:
Would it be better to remove the Or else get rid of the summary at the end (which only displays the time elapsed) and show the time elapsed when printing Except that 👍 for merge. |
$logger = null; | ||
if ($output->getVerbosity() <= OutputInterface::VERBOSITY_NORMAL) { | ||
$logger = new NullLogger(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this? The -q
flag should automatically set the error level at "error".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
During normal output (in addition to when -q
is used), we don't want the ArchivePurger logs to output in this command, but we want it to appear in scheduled task output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes I think we discussed that in slack! Could you maybe add a comment to explain it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment.
You're right, don't need the summary anymore, will remove it. |
…ed or rows deleted. For debugging, users can append -v to core:archive and email it to us.
Add logging to ArchivePurger service, task + Scheduler class & modify CronArchive so scheduled Task logs are displayed.
it looks like the output was not simplfied as much as possible so created follow up issue #7705 |
This pull request modifies CronArchive so scheduled task logging output displays in core:archive output, and adds logging to ArchivePurger + other classes.
We display scheduled task output in the core:archive process by going through the Request class instead of climulti:request.
Example scheduled task output:
Refs #7181