Skip to content

Commit

Permalink
fix: reduce notification payload size
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards1211 committed Jan 7, 2019
1 parent 2850b83 commit ce6aef1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/migrations/20190104204203-create-ShardReservations.sql
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ BEGIN
WHERE updated."cluster" = target_cluster AND updated.holder = src.holder
RETURNING updated.holder, updated.shard, src."numShards"
LOOP
PERFORM pg_notify('shardInfo/' || r.holder, row_to_json(r) #>> '{}');
PERFORM pg_notify(
'shardInfo/' || r.holder,
json_build_object('shard', r.shard, 'numShards', r."numShards") #>> '{}'
);
END LOOP;
END;
$$
Expand Down

0 comments on commit ce6aef1

Please sign in to comment.