mirror of
https://github.com/iv-org/invidious.git
synced 2025-01-09 11:00:34 +05:30
Improve syntax
Co-authored-by: syeopite <70992037+syeopite@users.noreply.github.com>
This commit is contained in:
parent
525dea1e2a
commit
b4a6193642
@ -248,11 +248,8 @@ Kemal.config.app_name = "Invidious"
|
|||||||
{% end %}
|
{% end %}
|
||||||
|
|
||||||
Kemal.run do |config|
|
Kemal.run do |config|
|
||||||
if CONFIG.socket_binding
|
if socket_binding = CONFIG.socket_binding
|
||||||
socket_binding = CONFIG.socket_binding.not_nil!
|
File.delete?(socket_binding.path)
|
||||||
if File.exists?(socket_binding.path)
|
|
||||||
File.delete(socket_binding.path)
|
|
||||||
end
|
|
||||||
# Create a socket and set its desired permissions
|
# Create a socket and set its desired permissions
|
||||||
server = UNIXServer.new(socket_binding.path)
|
server = UNIXServer.new(socket_binding.path)
|
||||||
perms = socket_binding.permissions.to_i(base: 8)
|
perms = socket_binding.permissions.to_i(base: 8)
|
||||||
|
@ -259,8 +259,7 @@ class Config
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Check if the socket configuration is valid
|
# Check if the socket configuration is valid
|
||||||
if config.socket_binding
|
if sb = config.socket_binding
|
||||||
sb = config.socket_binding.not_nil!
|
|
||||||
if sb.path.ends_with?("/") || File.directory?(sb.path)
|
if sb.path.ends_with?("/") || File.directory?(sb.path)
|
||||||
puts "Config: The socket path " + sb.path + " must not be a directory!"
|
puts "Config: The socket path " + sb.path + " must not be a directory!"
|
||||||
exit(1)
|
exit(1)
|
||||||
|
Loading…
Reference in New Issue
Block a user