Skip to content

Commit

Permalink
Accept newer array when merging
Browse files Browse the repository at this point in the history
  • Loading branch information
felixbrucker committed Apr 26, 2023
1 parent c6e82c2 commit 1aa0d56
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/service/stats-collection.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { Connection, ApiClient, constants } = require('chia-api');
const BigNumber = require('bignumber.js');
const { throttle, merge} = require('lodash');
const { throttle, mergeWith, isArray} = require('lodash');
const moment = require('moment');

const config = require('./config');
Expand Down Expand Up @@ -337,7 +337,15 @@ class StatsCollection {
if (config.enableCompatibilityMode) {
this.partialStats[service] = stats
} else {
this.partialStats[service] = merge((this.partialStats[service] || {}), partialStats)
this.partialStats[service] = mergeWith(
(this.partialStats[service] || {}),
partialStats,
(objValue, srcValue) => {
if (isArray(objValue)) {
return srcValue
}
}
)
}
}

Expand Down

0 comments on commit 1aa0d56

Please sign in to comment.