Skip to content

Commit 73d50ad

Browse files
feat: cache queries
Signed-off-by: Henry Gressmann <[email protected]>
1 parent 8682a31 commit 73d50ad

File tree

19 files changed

+331
-208
lines changed

19 files changed

+331
-208
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ The format is roughly based on the output of `git-cliff` and this project adhere
1616
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).
1717
-->
1818

19+
## [Unreleased]
20+
21+
### 🚀 Features
22+
23+
- Improved query caching to prevent unnecessary database queries
24+
- Added Country Code to Google Referrer URLs
25+
1926
## v1.0.0 - 2024-12-06
2027

2128
### 🚀 Features

Cargo.lock

Lines changed: 26 additions & 112 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,20 @@ path="src/main.rs"
1616

1717
[dependencies]
1818
# async/concurrency
19-
tokio={version="1.38", default-features=false, features=["rt-multi-thread"]}
19+
tokio={version="1.38", default-features=false, features=["macros", "rt-multi-thread"]}
2020
tokio-util={version="0.7", features=["io"]}
2121
futures-util="0.3"
22-
crossbeam="0.8"
22+
crossbeam-utils="0.8"
23+
crossbeam-channel="0.5"
24+
quick_cache="0.6"
2325

2426
# encoding
2527
hex={version="0.4"}
2628
bs58="0.5"
2729
serde={version="1.0", features=["derive"]}
2830
serde_json={version="1.0"}
2931
md-5="0.10"
30-
async-compression="0.4"
32+
async-compression={version="0.4", default-features=false, features=["gzip"]}
3133
tokio-tar={package="krata-tokio-tar", version="0.4"}
3234
sha3={version="0.10"}
3335
argon2={version="0.5"}
@@ -36,12 +38,10 @@ argon2={version="0.5"}
3638
argh={version="0.1"}
3739
eyre={version="0.6"}
3840
rand={version="0.8"}
39-
cached="0.54"
40-
itertools={version="0.13"}
4141
time={version="0.3"}
4242
colored={version="2.1"}
4343
figment={version="0.10", features=["toml", "env"]}
44-
tracing="0.1"
44+
tracing={version="0.1", default-features=false, features=["std"]}
4545
tracing-subscriber={version="0.3", features=["env-filter"]}
4646

4747
# web
@@ -56,7 +56,7 @@ poem-openapi={version="5.1", default-features=false, features=["time"]}
5656
tower={version="0.5", default-features=false, features=["limit"]}
5757
uaparser="0.6"
5858
mime_guess={version="2.0"}
59-
rust-embed="8.5"
59+
rust-embed={version="8.5"}
6060
reqwest={version="0.12", default-features=false, features=[
6161
"json",
6262
"stream",
@@ -73,8 +73,8 @@ duckdb={version="1.1", git="https://github.com/explodingcamera-contrib/duckdb-rs
7373
rusqlite={version="0.32", features=["bundled", "time"]}
7474
r2d2={version="0.8"}
7575
r2d2_sqlite="0.25"
76-
refinery={version="0.8"}
77-
refinery-core="0.8"
76+
refinery={version="0.8", default-features=false}
77+
refinery-core={version="0.8", default-features=false}
7878
maxminddb={version="0.24", optional=true}
7979

8080
[dev-dependencies]
@@ -94,8 +94,7 @@ incremental=true
9494
[profile.release]
9595
lto="thin"
9696
strip=true
97+
opt-level=2
9798

98-
[profile.dev.package.duckdb]
99-
inherits="release"
100-
[profile.dev.package.rusqlite]
101-
inherits="release"
99+
[profile.release.package.duckdb]
100+
opt-level=3

data/licenses-cargo.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/app/core.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ pub mod events;
33
pub mod onboarding;
44
pub mod projects;
55
pub mod reports;
6+
mod reports_cached;
67
pub mod sessions;
78
pub mod users;
89

src/app/core/events.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use std::sync::Arc;
22

3-
use crossbeam::{channel::Receiver, sync::ShardedLock};
3+
use crossbeam_channel::Receiver;
4+
use crossbeam_utils::sync::ShardedLock;
45
use eyre::{bail, Result};
56
use time::OffsetDateTime;
67

src/app/core/geoip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::sync::atomic::{AtomicBool, Ordering};
77
use std::sync::Arc;
88

99
use crate::app::SqlitePool;
10-
use crossbeam::sync::ShardedLock;
10+
use crossbeam_utils::sync::ShardedLock;
1111
use eyre::{OptionExt, Result};
1212
use futures_util::{StreamExt, TryStreamExt};
1313
use md5::{Digest, Md5};

src/app/core/onboarding.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::sync::Arc;
22

3-
use crossbeam::sync::ShardedLock;
3+
use crossbeam_utils::sync::ShardedLock;
44
use eyre::Result;
55

66
use crate::{app::SqlitePool, utils::hash::onboarding_token};

0 commit comments

Comments
 (0)