发布

  • [OPIK-6026] [BE] fix: replace in-memory analytics dedup with Redis and cache anonymous ID (#6397)

    frostbyte_neo 发布于 2026-04-21 08:26:15 +00:00

    • [OPIK-6026] [BE] fix: replace in-memory analytics dedup with Redis and cache anonymous ID

    • fix(bi): cache anonymous ID at the source in UsageReportService

    Move the anonymous ID cache from AnalyticsServiceImpl into
    UsageReportServiceImpl so all callers benefit (BiEventListener,
    DailyUsageReportJob, WelcomeWizardEventListener, AnalyticsService,
    InstallationReportService).

    The anonymous ID is immutable after first write — a volatile field
    ensures DB is hit at most once per JVM lifetime. saveAnonymousId()
    populates the cache on write so the creator doesn't need a follow-up
    DB read.

    Remove the redundant cachedAnonymousId field and getAnonymousId()
    method from AnalyticsServiceImpl — it now delegates directly to
    UsageReportService which handles caching.

    下载附件