-
Notifications
You must be signed in to change notification settings - Fork 6
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
Create and configure custom web status checker [API-417] #90
base: develop
Are you sure you want to change the base?
Conversation
|
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.
A few questions.
|
||
$this->info('Starting monitoring of domains: ' . implode(', ', $domains)); | ||
|
||
while (true) { |
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.
So we expect this command always to be running? while (true)
worries me. I wonder if, instead, we can think of this command as:
- Check all the domains in the list once, and log the status somewhere
- Go through the domain statuses and decide if any action needs to be taken on any of them
Then we can think of the code in this script as a single iteration, and have the Kernel below set to run the command every minute.
$this->info("Error monitoring {$domain}: " . $e->getMessage()); | ||
Log::error("Monitoring error for {$domain}: " . $e->getMessage()); |
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.
Could you just use $this->error()
here?
'text' => $message | ||
]); | ||
} catch (\Exception $e) { | ||
Log::error('Failed to send Slack message: ' . $e->getMessage()); |
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.
Consider $this->error()
for uniformity.
No description provided.