Skip to content
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

Clear Cloudflare cache if the command exists, otherwise log a warning message. The changes were made to handle the case when the cloudflare-cache:clear command does not exist. #20

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

thejmitchener
Copy link
Member

@thejmitchener thejmitchener commented Dec 18, 2024

Introduces a safeguard for the cloudflare-cache:clear command within the CloudflareCacheServiceProvider. The motivation behind this change is to enhance the robustness of our application by preventing potential errors when the command is not available.

Previously, the code attempted to call the cloudflare-cache:clear command unconditionally, which could lead to runtime exceptions if the command did not exist. With this update, we first check if the command is registered using Artisan::all(). If the command exists, it is executed; otherwise, a warning message is logged.

This improvement not only enhances error handling but also provides better visibility into the application's behavior during the boot process. By logging a warning when the command is missing, we can quickly identify configuration issues without causing the application to fail. Overall, this change contributes to a more stable and maintainable codebase.

… message. The changes were made to handle the case when the cloudflare-cache:clear command does not exist.
@thejmitchener thejmitchener enabled auto-merge (squash) December 18, 2024 21:10
@thejmitchener thejmitchener merged commit 0ce1ac6 into main Dec 18, 2024
7 checks passed
@thejmitchener thejmitchener deleted the refactor-automatic-cache-clearing branch December 18, 2024 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant