Skip to content

Commit

Permalink
Prefetch deps + use sparse registries + log connection string
Browse files Browse the repository at this point in the history
  • Loading branch information
Dzejkop committed Dec 5, 2023
1 parent 16de8e3 commit c148325
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[registries.crates-io]
protocol = "sparse"
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ RUN rustup component add cargo
COPY . .

# Build the binary
RUN cargo fetch
RUN cargo build --release --no-default-features

# Make sure it runs
Expand Down
4 changes: 4 additions & 0 deletions src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ pub struct Database {
impl Database {
pub async fn new(config: &DatabaseConfig) -> eyre::Result<Self> {
let connection_string = config.to_connection_string();

// TODO: Remove this!
tracing::info!("Connecting to database: {}", connection_string);

let pool = loop {
if !Postgres::database_exists(&connection_string).await? {
Postgres::create_database(&connection_string).await?;
Expand Down

0 comments on commit c148325

Please sign in to comment.