Improve syntax

Co-authored-by: syeopite <70992037+syeopite@users.noreply.github.com>
This commit is contained in:
Caian Benedicto 2025-01-05 09:56:00 +00:00 committed by GitHub
parent 525dea1e2a
commit b4a6193642
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 7 deletions

View File

@ -248,11 +248,8 @@ Kemal.config.app_name = "Invidious"
{% end %}
Kemal.run do |config|
if CONFIG.socket_binding
socket_binding = CONFIG.socket_binding.not_nil!
if File.exists?(socket_binding.path)
File.delete(socket_binding.path)
end
if socket_binding = CONFIG.socket_binding
File.delete?(socket_binding.path)
# Create a socket and set its desired permissions
server = UNIXServer.new(socket_binding.path)
perms = socket_binding.permissions.to_i(base: 8)

View File

@ -259,8 +259,7 @@ class Config
end
# Check if the socket configuration is valid
if config.socket_binding
sb = config.socket_binding.not_nil!
if sb = config.socket_binding
if sb.path.ends_with?("/") || File.directory?(sb.path)
puts "Config: The socket path " + sb.path + " must not be a directory!"
exit(1)