Compare commits

...
2 Commits
Author SHA1 Message Date
semantic-release-bot 2596b357ec chore(release): 1.3.5 [skip ci]
## [1.3.5](https://github.com/asepharyana/mytheclipse/compare/v1.3.4...v1.3.5) (2026-08-28)

### Bug Fixes

* **cache:** honor sub-second Redis TTL via PSETEX + document clear() safety ([2c9367a](https://github.com/asepharyana/mytheclipse/commit/2c9367a83c2dd01b1e197ec33215a6c7d3755fa2))
2026-08-28 18:36:29 +00:00
asepharyana 2c9367a83c fix(cache): honor sub-second Redis TTL via PSETEX + document clear() safety 2026-08-29 01:35:42 +07:00
12 changed files with 359 additions and 17 deletions
+7
View File
@@ -1,3 +1,10 @@
## [1.3.5](https://github.com/asepharyana/mytheclipse/compare/v1.3.4...v1.3.5) (2026-08-28)
### Bug Fixes
* **cache:** honor sub-second Redis TTL via PSETEX + document clear() safety ([2c9367a](https://github.com/asepharyana/mytheclipse/commit/2c9367a83c2dd01b1e197ec33215a6c7d3755fa2))
## [1.3.4](https://github.com/asepharyana/mytheclipse/compare/v1.3.3...v1.3.4) (2026-08-28)
Generated
+6 -6
View File
@@ -2539,7 +2539,7 @@ dependencies = [
[[package]]
name = "mytheclipse"
version = "1.3.4"
version = "1.3.5"
dependencies = [
"num_cpus",
"rand 0.8.8",
@@ -2551,7 +2551,7 @@ dependencies = [
[[package]]
name = "mytheclipse-cache"
version = "1.3.4"
version = "1.3.5"
dependencies = [
"async-trait",
"moka",
@@ -2564,7 +2564,7 @@ dependencies = [
[[package]]
name = "mytheclipse-config"
version = "1.3.4"
version = "1.3.5"
dependencies = [
"dotenvy",
"notify",
@@ -2579,7 +2579,7 @@ dependencies = [
[[package]]
name = "mytheclipse-crypto"
version = "1.3.4"
version = "1.3.5"
dependencies = [
"aead",
"aes-gcm",
@@ -2596,7 +2596,7 @@ dependencies = [
[[package]]
name = "mytheclipse-event"
version = "1.3.4"
version = "1.3.5"
dependencies = [
"async-nats",
"async-trait",
@@ -2612,7 +2612,7 @@ dependencies = [
[[package]]
name = "mytheclipse-storage"
version = "1.3.4"
version = "1.3.5"
dependencies = [
"async-trait",
"aws-config",
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "mytheclipse-cache"
version = "1.3.4"
version = "1.3.5"
edition = "2021"
rust-version = "1.75"
license = "MIT OR Apache-2.0"
+19 -5
View File
@@ -69,8 +69,18 @@ impl Cache for RedisCache {
let k = self.key(key);
match ttl {
Some(ttl) => {
let secs = ttl.as_secs().max(1);
let result: Result<(), RedisError> = c.set_ex(&k, value, secs).await;
// Use millisecond precision (PSETEX) so sub-second TTLs are
// honored faithfully. Previously `set_ex(seconds.max(1))`
// rounded anything < 1s up to 1s, silently changing expiry
// semantics for short-lived cache entries.
let ms = ttl.as_millis();
if ms == 0 {
return Err(CacheError::Key(
"ttl of 0ms not allowed — pass None to store permanently".into(),
));
}
let ms = ms as u64;
let result: Result<(), RedisError> = c.pset_ex(&k, value, ms).await;
result.map_err(map_err)
}
None => {
@@ -88,9 +98,13 @@ impl Cache for RedisCache {
}
async fn clear(&self) -> Result<(), CacheError> {
// Deliberately does nothing: `FLUSHALL`/`FLUSHDB` are dangerous on a
// shared instance. Consumers should scope keys under a prefix and call
// `invalidate` for the keys they own.
// Deliberately does nothing: a blind `FLUSHDB`/`FLUSHALL` on a shared
// Redis instance would destroy keys owned by other consumers.
// Consumers that need a true wipe must either (a) use a dedicated Redis
// DB / namespace prefix they own exclusively, or (b) call
// `invalidate` per-key for the keys they manage.
//
// See: https://redis.io/commands/flushdb/ (no key-scoping)
Ok(())
}
}
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "mytheclipse-config"
version = "1.3.4"
version = "1.3.5"
edition = "2021"
rust-version = "1.75"
license = "MIT OR Apache-2.0"
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "mytheclipse-crypto"
version = "1.3.4"
version = "1.3.5"
edition = "2021"
rust-version = "1.75"
license = "MIT OR Apache-2.0"
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "mytheclipse-event"
version = "1.3.4"
version = "1.3.5"
edition = "2021"
rust-version = "1.75"
license = "MIT OR Apache-2.0"
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "mytheclipse-storage"
version = "1.3.4"
version = "1.3.5"
edition = "2021"
rust-version = "1.75"
license = "MIT OR Apache-2.0"
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "mytheclipse"
version = "1.3.4"
version = "1.3.5"
edition = "2021"
rust-version = "1.75"
license = "MIT OR Apache-2.0"