Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…o 0.x
  • Loading branch information
asavann committed May 30, 2024
2 parents 2c4887d + ae88170 commit 795a3a3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
20 changes: 9 additions & 11 deletions app/Models/YnhServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,12 @@ public function status(): ServerStatusEnum
}

// Check if status is running
$minDate = Carbon::today()->subMinutes(10);
$minDate = Carbon::now()->subMinutes(10);
$isRunning = collect(DB::select("
SELECT COUNT(*) AS count
FROM ynh_osquery
WHERE ynh_server_id = {$this->id}
-- AND name IN ('memory_available_snapshot', 'disk_available_snapshot')
AND calendar_time >= '{$minDate->toDateTimeString()}'
SELECT COUNT(id) AS count
FROM ynh_osquery
WHERE ynh_server_id = {$this->id}
AND calendar_time >= '{$minDate->toDateTimeString()}'
"))->first();

if ($isRunning->count > 0) {
Expand All @@ -173,11 +172,10 @@ public function status(): ServerStatusEnum
// Check if status is unknown
$minDate = $minDate->subMinutes(10);
$isUnknown = collect(DB::select("
SELECT COUNT(*) AS count
FROM ynh_osquery
WHERE ynh_server_id = {$this->id}
-- AND name IN ('memory_available_snapshot', 'disk_available_snapshot')
AND calendar_time >= '{$minDate->toDateTimeString()}'
SELECT COUNT(id) AS count
FROM ynh_osquery
WHERE ynh_server_id = {$this->id}
AND calendar_time >= '{$minDate->toDateTimeString()}'
"))->first();

if ($isUnknown->count > 0) {
Expand Down
2 changes: 0 additions & 2 deletions resources/views/home/cards/_towerify_domains.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,4 @@
</div>
@endif
</div>
<script>
</script>
@endif

0 comments on commit 795a3a3

Please sign in to comment.