Skip to content

Feedback in cache:clear #9463

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

Closed
wants to merge 7 commits into from
Closed

Feedback in cache:clear #9463

wants to merge 7 commits into from

Conversation

jrmyio
Copy link
Contributor

@jrmyio jrmyio commented Nov 7, 2013

Especially in production it is sometimes critical to know exactly when your cache is cleared or warmed up. Currently cache:clear provides no feedback whats however. As sites get bigger, so become their cache files. Removing old cache files may sometimes even take minutes. Without any feedback from the cache:clear you do not know the current status.

That's why i added more feedback to the cache:clear command that it makes it possible to see when your cache is warmed up and ready to go.

@stof
Copy link
Member

stof commented Nov 7, 2013

I suggest displaying these additional messages only in verbose mode

@jrmyio
Copy link
Contributor Author

jrmyio commented Nov 8, 2013

@stof I changed it so that the messages are only shown in verbose + I added a ":" after the default start message

@@ -77,9 +78,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
$warmupDir = substr($realCacheDir, 0, -1).'_';

if ($filesystem->exists($warmupDir)) {
$this->writelnIfVerbose($output, 'Clearing outdated warmup directory...');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leave a space after directory

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope

@jrmyio
Copy link
Contributor Author

jrmyio commented Nov 8, 2013

Better start using PHPCS before doing a pull request ^_^.

I guess I will have to make a different brance to add the updates and i'll run phpcs.

* @param OutputInterface $output
* @return bool
*/
protected function isVerbose(OutputInterface $output){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@fabpot
Copy link
Member

fabpot commented Nov 28, 2013

This PR does more than changing the cache:clear command. Can you revert all the other changes?

@fabpot
Copy link
Member

fabpot commented Dec 29, 2013

@ConneXNL Can you clean up this PR?

@@ -87,9 +90,41 @@ protected function execute(InputInterface $input, OutputInterface $output)
sleep(1); // workaround for windows php rename bug
}
$filesystem->rename($warmupDir, $realCacheDir);
$this->writelnIfVerbose($output, 'Warm up completed...');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to remove the 3 dots.

@fabpot
Copy link
Member

fabpot commented Jan 7, 2014

Closing in favor of #9966

@fabpot fabpot closed this Jan 7, 2014
fabpot added a commit that referenced this pull request Jan 7, 2014
This PR was merged into the 2.5-dev branch.

Discussion
----------

added feedback to the cache:clear command

simplified version of #9463

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #9463
| License       | MIT
| Doc PR        | n/a

"Especially in production it is sometimes critical to know exactly when your cache is cleared or warmed up. Currently cache:clear provides no feedback whats however. As sites get bigger, so become their cache files. Removing old cache files may sometimes even take minutes. Without any feedback from the cache:clear you do not know the current status.

That's why i added more feedback to the cache:clear command that it makes it possible to see when your cache is warmed up and ready to go."

Commits
-------

f2261da [FrameworkBundle] simplified code
a1f6411 [FrameworkBundle] added feedback in cache:clear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants