commit 2c2270351bf133b67edabbce16544893ce85b543
parent a12fe3b5570497d97dd96c25b73b330a0f17a898
Author: Henrique Chan Carvalho Machado <henriqueccmachado@tecnico.ulisboa.pt>
Date: Tue, 25 Nov 2025 23:08:52 +0100
Revert "oauth2_gateway: fix socket delete on restart"
This reverts commit a12fe3b5570497d97dd96c25b73b330a0f17a898.
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/oauth2_gateway/src/main.rs b/oauth2_gateway/src/main.rs
@@ -52,6 +52,11 @@ async fn main() -> Result<()> {
if config.server.is_unix_socket() {
let socket_path = config.server.socket_path.as_ref().unwrap();
+ if std::path::Path::new(socket_path).exists() {
+ tracing::warn!("Removing existing socket file: {}", socket_path);
+ std::fs::remove_file(socket_path)?;
+ }
+
let listener = tokio::net::UnixListener::bind(socket_path)?;
tracing::info!("Server listening on Unix socket: {}", socket_path);