Merge pull request #85 from blockworks-foundation/postgres_fix
Postgres Fix
This commit is contained in:
commit
1d147c45fa
|
@ -20,4 +20,4 @@ FROM debian:bullseye-slim as run
|
|||
RUN apt-get update && apt-get -y install ca-certificates libc6
|
||||
COPY --from=build /app/target/release/lite-rpc /usr/local/bin/
|
||||
|
||||
CMD lite-rpc --rpc-addr "$RPC_URL" --ws-addr "$WS_URL"
|
||||
CMD lite-rpc --rpc-addr "$RPC_URL" --ws-addr "$WS_URL" -p
|
||||
|
|
|
@ -98,6 +98,12 @@ impl PostgresSession {
|
|||
let connector = MakeTlsConnector::new(connector);
|
||||
let (client, connection) = tokio_postgres::connect(&pg_config, connector.clone()).await?;
|
||||
|
||||
tokio::spawn(async move {
|
||||
if let Err(err) = connection.await {
|
||||
log::error!("Connection to Postgres broke {err:?}");
|
||||
};
|
||||
});
|
||||
|
||||
let insert_block_statement = client
|
||||
.prepare(
|
||||
r#"
|
||||
|
@ -128,12 +134,6 @@ impl PostgresSession {
|
|||
)
|
||||
.await?;
|
||||
|
||||
tokio::spawn(async move {
|
||||
if let Err(err) = connection.await {
|
||||
log::error!("Connection to Postgres broke {err:?}");
|
||||
};
|
||||
});
|
||||
|
||||
Ok(Self {
|
||||
client,
|
||||
insert_tx_statement,
|
||||
|
|
Loading…
Reference in New Issue