mirror of
https://github.com/aljazceru/cdk.git
synced 2026-01-04 05:25:26 +01:00
The bug comes with the SQLx-sqlite pool bug, where several connections are
created by default, but the `new` function takes care of that, fixing that bug
by making a single instance of the database.
If constructed directly, the pool would create several connections to the
database, which in most instances is fine, but with SQLite :memory: each
connection is entirely independent.
Also follow documentation to make sure that failed `acquire` will not end up
dropping connections by setting test_before_acquire to false
However, if your workload is sensitive to dropped connections such as using an in-memory
SQLite database with a pool size of 1, you can pretty easily ensure that a cancelled
`acquire()` call will never drop connections by tweaking your [`PoolOptions`]:
* Set [`test_before_acquire(false)`][PoolOptions::test_before_acquire]
* Never set [`before_acquire`][PoolOptions::before_acquire] or
[`after_connect`][PoolOptions::after_connect].
cdk-mintd
Building from source
nix develop
Build
cargo b --bin cdk-mintd -r
Configuration
Copy example config to cdk-mintd working directory.
cp ./example.config.toml ~/.cdk-mintd/config.toml
Edit config file
vi ~/.cdk-mintd/config.toml
Running with Docker
Build the Docker image
docker build -t cdk-mintd .
Run the Docker container with the configuration file mapped
docker run -v ~/.cdk-mintd/config.toml:/root/.cdk-mintd/config.toml cdk-mintd