mirror of
https://github.com/MeshCore-Beacon/beacon-server.git
synced 2026-10-23 11:02:25 +00:00
fix: address maintainer review for #169
This commit is contained in:
1 parent
5977e42c5c
commit
d3c330e8fb
17 files changed
+183
-360
No files matched your search
Vendored
+3
@@ -373,6 +373,9 @@ func (cr *CachedReader) GetObserverTelemetryBucketed(ctx context.Context, observ
|
||||
|
||||
// GetObserverActivity implements [api.Reader].
|
||||
func (cr *CachedReader) GetObserverActivity(ctx context.Context, observerID uuid.UUID, window, interval time.Duration, until time.Time) (*api.ObserverActivity, error) {
|
||||
if !until.IsZero() {
|
||||
until = until.UTC().Truncate(interval)
|
||||
}
|
||||
key := keyObserverActivityPrefix + observerID.String() + ":" + window.String() + ":" + interval.String() + ":" + until.UTC().Format(time.RFC3339Nano)
|
||||
return getOrSet(ctx, cr.c, key, observerActivityTTL, func() (*api.ObserverActivity, error) {
|
||||
return cr.inner.GetObserverActivity(ctx, observerID, window, interval, until)
|
||||
|
||||
Reference in new issue
Block a user