fix(mixins/Config#watch): use deep equality to check changes
Because objects (and arrays) will always be new ones and thus different.
This commit is contained in:
parent
f5473236d0
commit
f5111c0f41
@ -1,5 +1,6 @@
|
|||||||
const get = require('lodash/get')
|
const get = require('lodash/get')
|
||||||
const identity = require('lodash/identity')
|
const identity = require('lodash/identity')
|
||||||
|
const isEqual = require('lodash/isEqual')
|
||||||
const { createLogger } = require('@xen-orchestra/log')
|
const { createLogger } = require('@xen-orchestra/log')
|
||||||
const { parseDuration } = require('@vates/parse-duration')
|
const { parseDuration } = require('@vates/parse-duration')
|
||||||
const { watch } = require('app-conf')
|
const { watch } = require('app-conf')
|
||||||
@ -48,7 +49,7 @@ module.exports = class Config {
|
|||||||
const watcher = config => {
|
const watcher = config => {
|
||||||
try {
|
try {
|
||||||
const value = processor(get(config, path))
|
const value = processor(get(config, path))
|
||||||
if (value !== prev) {
|
if (!isEqual(value, prev)) {
|
||||||
prev = value
|
prev = value
|
||||||
cb(value)
|
cb(value)
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
> In case of conflict, the highest (lowest in previous list) `$version` wins.
|
> In case of conflict, the highest (lowest in previous list) `$version` wins.
|
||||||
|
|
||||||
- @xen-orchestra/log minor
|
- @xen-orchestra/log minor
|
||||||
|
- @xen-orchestra/mixins patch
|
||||||
- xo-server-auth-ldap patch
|
- xo-server-auth-ldap patch
|
||||||
- xo-server patch
|
- xo-server patch
|
||||||
- xo-web minor
|
- xo-web minor
|
||||||
|
Loading…
Reference in New Issue
Block a user