From 0ca21d0b3f32198546f8120d47bd296c61e881af Mon Sep 17 00:00:00 2001 From: MooCat <43627985+mooleshacat@users.noreply.github.com> Date: Tue, 22 Oct 2024 00:04:10 -0400 Subject: [PATCH] Update uptime.cr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Shorten the code 👍 --- src/invidious/helpers/uptime.cr | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/invidious/helpers/uptime.cr b/src/invidious/helpers/uptime.cr index f406cc48..c6402e6e 100644 --- a/src/invidious/helpers/uptime.cr +++ b/src/invidious/helpers/uptime.cr @@ -7,10 +7,7 @@ class Invidious::Uptime if CONFIG.uptime_enabled # get the uptime - uptime_cmd = "/usr/bin/uptime" - uptime_args = "-p" - process = Process.new(uptime_cmd, [uptime_args], output: Process::Redirect::Pipe) - str_uptime = process.output.gets_to_end + str_uptime = `/usr/bin/uptime -p` else str_uptime = "" @@ -20,4 +17,4 @@ class Invidious::Uptime end -end \ No newline at end of file +end