mirror of
https://github.com/Unleash/unleash.git
synced 2025-04-06 01:15:28 +02:00
fix: Store metrics only if not empty (#991)
This commit is contained in:
parent
35f2f92257
commit
f6169540a5
@ -140,8 +140,12 @@ export default class ClientMetricsService {
|
|||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const value = await clientMetricsSchema.validateAsync(data);
|
const value = await clientMetricsSchema.validateAsync(data);
|
||||||
const toggleNames = Object.keys(value.bucket.toggles);
|
const toggleNames = Object.keys(value.bucket.toggles);
|
||||||
await this.featureToggleStore.setLastSeen(toggleNames);
|
|
||||||
await this.clientMetricsStore.insert(value);
|
if (toggleNames.length > 0) {
|
||||||
|
await this.featureToggleStore.setLastSeen(toggleNames);
|
||||||
|
await this.clientMetricsStore.insert(value);
|
||||||
|
}
|
||||||
|
|
||||||
await this.clientInstanceStore.insert({
|
await this.clientInstanceStore.insert({
|
||||||
appName: value.appName,
|
appName: value.appName,
|
||||||
instanceId: value.instanceId,
|
instanceId: value.instanceId,
|
||||||
|
Loading…
Reference in New Issue
Block a user