Compare commits

...

2 commits

Author SHA1 Message Date
Tobias Reisinger 11e1a51a2a
Add parameter for db pool size 2024-05-10 18:03:02 +02:00
Tobias Reisinger 9a87e502f7
Fix some workflow problems 2024-05-10 13:29:24 +02:00
3 changed files with 4 additions and 28 deletions

View file

@ -1,26 +0,0 @@
on:
push:
tags:
- v**
jobs:
build-artifacts:
runs-on: docker
container:
image: registry.serguzim.me/emgauwa/runner
strategy:
matrix:
arch:
- x86_64-unknown-linux-gnu # for "standard" systems
- x86_64-unknown-linux-musl # for docker
- arm-unknown-linux-gnueabihf # for raspberry pi
steps:
- uses: https://code.forgejo.org/actions/checkout@v3
- id: cargo-build-release
run: |
source "$HOME/.cargo/env"
cross build --target ${{ matrix.arch }} --release
shell: bash
- uses: https://code.forgejo.org/actions/upload-artifact@v3
with:
name: emgauwa-core_${{ matrix.arch }}
path: ${{ github.workspace }}/target/${{ matrix.arch }}/release/emgauwa-core

View file

@ -12,7 +12,7 @@ clean:
rm -f emgauwa-core.sqlite rm -f emgauwa-core.sqlite
emgauwa-core_%: emgauwa-core_%:
$(TOOL) build --target $* --release --bin emgauwa-core $(TOOL) build --target $* --release
mkdir -p out/releases mkdir -p out/releases
cp target/$*/release/emgauwa-core out/releases/emgauwa-core_$* cp target/$*/release/emgauwa-core out/releases/emgauwa-core_$*

View file

@ -27,7 +27,8 @@ async fn main() -> Result<(), std::io::Error> {
init_logging(&settings.logging.level)?; init_logging(&settings.logging.level)?;
let pool = emgauwa_common::db::init(&settings.database).await?; let pool_size = 10;
let pool = emgauwa_common::db::init(&settings.database, pool_size).await?;
let mut conn = pool.acquire().await.map_err(EmgauwaError::from)?; let mut conn = pool.acquire().await.map_err(EmgauwaError::from)?;
DbController::all_inactive(&mut conn) DbController::all_inactive(&mut conn)
@ -112,6 +113,7 @@ async fn main() -> Result<(), std::io::Error> {
.service(handlers::v1::ws::ws_relays), .service(handlers::v1::ws::ws_relays),
) )
}) })
.workers((pool_size / 2) as usize)
.listen(listener)? .listen(listener)?
.run() .run()
.await .await