Skip to content

Commit

Permalink
feat: cache queries
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
  • Loading branch information
explodingcamera committed Dec 14, 2024
1 parent 8682a31 commit 73d50ad
Show file tree
Hide file tree
Showing 19 changed files with 331 additions and 208 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ The format is roughly based on the output of `git-cliff` and this project adhere
Since this is not a library, this changelog focuses on the changes that are relevant to the end-users. For a detailed list of changes, see the commit history, which adheres to [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). New releases are created automatically when a new tag is pushed (Commit message: chore(release): vX.X.X).
-->

## [Unreleased]

### 🚀 Features

- Improved query caching to prevent unnecessary database queries
- Added Country Code to Google Referrer URLs

## v1.0.0 - 2024-12-06

### 🚀 Features
Expand Down
138 changes: 26 additions & 112 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 12 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,20 @@ path="src/main.rs"

[dependencies]
# async/concurrency
tokio={version="1.38", default-features=false, features=["rt-multi-thread"]}
tokio={version="1.38", default-features=false, features=["macros", "rt-multi-thread"]}
tokio-util={version="0.7", features=["io"]}
futures-util="0.3"
crossbeam="0.8"
crossbeam-utils="0.8"
crossbeam-channel="0.5"
quick_cache="0.6"

# encoding
hex={version="0.4"}
bs58="0.5"
serde={version="1.0", features=["derive"]}
serde_json={version="1.0"}
md-5="0.10"
async-compression="0.4"
async-compression={version="0.4", default-features=false, features=["gzip"]}
tokio-tar={package="krata-tokio-tar", version="0.4"}
sha3={version="0.10"}
argon2={version="0.5"}
Expand All @@ -36,12 +38,10 @@ argon2={version="0.5"}
argh={version="0.1"}
eyre={version="0.6"}
rand={version="0.8"}
cached="0.54"
itertools={version="0.13"}
time={version="0.3"}
colored={version="2.1"}
figment={version="0.10", features=["toml", "env"]}
tracing="0.1"
tracing={version="0.1", default-features=false, features=["std"]}
tracing-subscriber={version="0.3", features=["env-filter"]}

# web
Expand All @@ -56,7 +56,7 @@ poem-openapi={version="5.1", default-features=false, features=["time"]}
tower={version="0.5", default-features=false, features=["limit"]}
uaparser="0.6"
mime_guess={version="2.0"}
rust-embed="8.5"
rust-embed={version="8.5"}
reqwest={version="0.12", default-features=false, features=[
"json",
"stream",
Expand All @@ -73,8 +73,8 @@ duckdb={version="1.1", git="https://github.com/explodingcamera-contrib/duckdb-rs
rusqlite={version="0.32", features=["bundled", "time"]}
r2d2={version="0.8"}
r2d2_sqlite="0.25"
refinery={version="0.8"}
refinery-core="0.8"
refinery={version="0.8", default-features=false}
refinery-core={version="0.8", default-features=false}
maxminddb={version="0.24", optional=true}

[dev-dependencies]
Expand All @@ -94,8 +94,7 @@ incremental=true
[profile.release]
lto="thin"
strip=true
opt-level=2

[profile.dev.package.duckdb]
inherits="release"
[profile.dev.package.rusqlite]
inherits="release"
[profile.release.package.duckdb]
opt-level=3
2 changes: 1 addition & 1 deletion data/licenses-cargo.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/app/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pub mod events;
pub mod onboarding;
pub mod projects;
pub mod reports;
mod reports_cached;
pub mod sessions;
pub mod users;

Expand Down
3 changes: 2 additions & 1 deletion src/app/core/events.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::sync::Arc;

use crossbeam::{channel::Receiver, sync::ShardedLock};
use crossbeam_channel::Receiver;
use crossbeam_utils::sync::ShardedLock;
use eyre::{bail, Result};
use time::OffsetDateTime;

Expand Down
2 changes: 1 addition & 1 deletion src/app/core/geoip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;

use crate::app::SqlitePool;
use crossbeam::sync::ShardedLock;
use crossbeam_utils::sync::ShardedLock;
use eyre::{OptionExt, Result};
use futures_util::{StreamExt, TryStreamExt};
use md5::{Digest, Md5};
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/onboarding.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::sync::Arc;

use crossbeam::sync::ShardedLock;
use crossbeam_utils::sync::ShardedLock;
use eyre::Result;

use crate::{app::SqlitePool, utils::hash::onboarding_token};
Expand Down
Loading

0 comments on commit 73d50ad

Please sign in to comment.