refactor: postgres_backend: replace abstract shutdown_watcher with CancellationToken (#8295)

Preliminary refactoring while working on
https://github.com/neondatabase/neon/issues/7427
and specifically https://github.com/neondatabase/neon/pull/8286
This commit is contained in:
Christian Schwarz
2024-07-09 20:11:11 +02:00
committed by GitHub
parent abc330e095
commit 3f7aebb01c
8 changed files with 28 additions and 34 deletions

View File

@@ -4,9 +4,10 @@
//!
use anyhow::{Context, Result};
use postgres_backend::QueryError;
use std::{future, time::Duration};
use std::time::Duration;
use tokio::net::TcpStream;
use tokio_io_timeout::TimeoutReader;
use tokio_util::sync::CancellationToken;
use tracing::*;
use utils::{auth::Scope, measured_stream::MeasuredStream};
@@ -100,7 +101,7 @@ async fn handle_socket(
// libpq protocol between safekeeper and walproposer / pageserver
// We don't use shutdown.
pgbackend
.run(&mut conn_handler, future::pending::<()>)
.run(&mut conn_handler, &CancellationToken::new())
.await
}