Normalize IDs in distributeUpdate function for consistent publishing to NATS server
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit is contained in:
parent
f15ba0e489
commit
e475cddb65
@ -1722,7 +1722,11 @@ function filterDistributeKeys(value, keys = DISTRIBUTE_KEYS) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function distributeUpdate(value, id, type) {
|
async function distributeUpdate(value, id, type) {
|
||||||
await natsServer.publish(`${type}s.${id}.object`, { ...value, _id: id });
|
const normalizedId = id == null ? id : String(id).toLowerCase();
|
||||||
|
await natsServer.publish(`${type}s.${normalizedId}.object`, {
|
||||||
|
...value,
|
||||||
|
_id: normalizedId,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function distributeStats(value, type) {
|
async function distributeStats(value, type) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user