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

Create and configure custom web status checker [API-417] #90

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

web-dev-trev
Copy link
Member

No description provided.

Copy link
Member

@nikhiltri nikhiltri left a 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) {
Copy link
Member

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:

  1. Check all the domains in the list once, and log the status somewhere
  2. 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.

Comment on lines +60 to +61
$this->info("Error monitoring {$domain}: " . $e->getMessage());
Log::error("Monitoring error for {$domain}: " . $e->getMessage());
Copy link
Member

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());
Copy link
Member

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.

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.

2 participants