18 Commits
Author SHA1 Message Date
qwqcode 0b44989e5f fix(cache): return database results on store failure
Treat cache writes as best-effort after a successful database query. Keep database errors authoritative and cover both paths with a failing store.

Fixes #1154
2026-07-22 22:20:28 +08:00
qwqcode cf7725edba refactor(go): bump the module version and support go install (#979)
BREAKING CHANGE: The original Go module name was `github.com/ArtalkJS/Artalk`, which has now been modified to `github.com/artalkjs/artalk/v2` (all lowercase). This change may affect the CI pipeline or other areas if you are compiling the Artalk server and have specified the fixed Go module name. Regarding the original `-ldflags -X github.com/ArtalkJS/Artalk/internal/config.Version` and `CommitHash` definitions, please remove them, as they are now obsolete. The `Version` has been hardcoded into the Go code, and the `CommitHash` is now read from the Go build info via runtime/debug’s vcs.revision value. This change only affects the server developers and does not impact the frontend UI client.
2024-09-18 21:43:43 +08:00
qwqcode c3558b7beb perf(dao): add singleflight for no-cache db find func 2024-06-08 13:48:37 +08:00
qwqcode d2161cc0fb refactor(dao): improve QueryDBWithCache func and concurrent unit tests (#884) 2024-05-26 17:15:32 +08:00
qwqcode b613a4368c fix(log): improve log system and fix memory leaks (#843) 2024-04-18 18:25:19 +08:00
Zijing Zhang f56ac4eabc perf(cache): implement GC feature for simple_cache pkg (#656)
* feat: garbage collection feature

A new `GC()` method has been added to the `Cache` struct,
which performs garbage collection by deleting expired entries from the
cache.
2023-12-17 02:32:47 +08:00
qwqcode 2dc3bc8934 test(simple_cache): add unit test 2023-09-25 21:15:58 +08:00
qwqcode 9e59fefc8a test(cache): add tests for cache and dao cache adaptor 2023-09-01 17:02:00 +08:00
qwqcode 6ead92db54 refactor(cache): cache code tidy-up 2023-09-01 17:02:00 +08:00
qwqcode 388b5b8b24 refactor(cache): refactor cache pkg 2023-09-01 17:02:00 +08:00
qwqcode 3af4482db6 refactor(cache): refactor cache pkg 2023-09-01 17:01:59 +08:00
qwqcode d4f0ae8ad7 feat(simple_cache): a simple thread-safe cache with sync.Map 2023-09-01 17:01:55 +08:00
qwqcode a06928378a refactor(cache): refactor cache pkg 2023-09-01 17:01:54 +08:00
qwqcode 2b990ff433 feat(go): upgrade golang to v1.20.3 and some deps (#485)
Signed-off-by: qwqcode <qwqcode@gmail.com>
2023-04-09 20:06:00 +08:00
qwqcode 3060ad8d3a chore(deps): upgrade go deps
Signed-off-by: qwqcode <qwqcode@gmail.com>
2023-02-04 19:28:25 +08:00
qwqcode 1ca892fc2d feat(i18n): translations for backend (#344)
* i18n: add i18n for server pacakge

Signed-off-by: qwqcode <qwqcode@gmail.com>

* i18n: add i18n for cmd pacakge

Signed-off-by: qwqcode <qwqcode@gmail.com>

* feat: add mustache syntax support for i18n.T in backend

Signed-off-by: qwqcode <qwqcode@gmail.com>

* i18n: improve i18n for backend further

Signed-off-by: qwqcode <qwqcode@gmail.com>

* i18n: `zh-CN` translation for backend

Signed-off-by: qwqcode <qwqcode@gmail.com>

Signed-off-by: qwqcode <qwqcode@gmail.com>
2023-01-19 20:17:32 +08:00
pluveto 697ed7282a refactor: batch removing artalk -go postfix 2023-01-17 05:37:45 +00:00
pluveto 4f046f8d0e refactor: move from tmp dir to root 2023-01-16 21:34:24 +08:00