Skip to content

Commit 3b1714c

Browse files
committed
formatting
1 parent f10db03 commit 3b1714c

File tree

1 file changed

+33
-23
lines changed

1 file changed

+33
-23
lines changed

deps/rabbitmq_stream/src/rabbit_stream_reader.erl

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,8 @@ open(cast,
10071007
SendFileOct)
10081008
of
10091009
{error, closed} ->
1010-
rabbit_log_connection:info("Stream protocol connection has been closed by peer", []),
1010+
rabbit_log_connection:info("Stream protocol connection has been closed by peer",
1011+
[]),
10111012
throw({stop, normal});
10121013
{error, Reason} ->
10131014
rabbit_log_connection:info("Error while sending chunks: ~p",
@@ -1823,38 +1824,46 @@ handle_frame_post_auth(Transport,
18231824
rabbit_log:debug("Distributing existing messages to subscription ~p",
18241825
[SubscriptionId]),
18251826

1826-
case send_chunks(Transport, ConsumerState, SendFileOct) of
1827+
case send_chunks(Transport, ConsumerState,
1828+
SendFileOct)
1829+
of
18271830
{error, closed} ->
1828-
rabbit_log_connection:info("Stream protocol connection has been closed by peer", []),
1831+
rabbit_log_connection:info("Stream protocol connection has been closed by peer",
1832+
[]),
18291833
throw({stop, normal});
18301834
{{segment, Segment1}, {credit, Credit1}} ->
18311835
ConsumerState1 =
1832-
ConsumerState#consumer{segment = Segment1,
1833-
credit = Credit1},
1836+
ConsumerState#consumer{segment =
1837+
Segment1,
1838+
credit =
1839+
Credit1},
18341840
Consumers1 =
1835-
Consumers#{SubscriptionId => ConsumerState1},
1841+
Consumers#{SubscriptionId =>
1842+
ConsumerState1},
18361843

18371844
StreamSubscriptions1 =
1838-
case StreamSubscriptions of
1839-
#{Stream := SubscriptionIds} ->
1840-
StreamSubscriptions#{Stream =>
1841-
[SubscriptionId]
1842-
++ SubscriptionIds};
1843-
_ ->
1844-
StreamSubscriptions#{Stream =>
1845-
[SubscriptionId]}
1846-
end,
1845+
case StreamSubscriptions of
1846+
#{Stream := SubscriptionIds} ->
1847+
StreamSubscriptions#{Stream =>
1848+
[SubscriptionId]
1849+
++ SubscriptionIds};
1850+
_ ->
1851+
StreamSubscriptions#{Stream =>
1852+
[SubscriptionId]}
1853+
end,
18471854

18481855
#consumer{counters = ConsumerCounters1} =
1849-
ConsumerState1,
1856+
ConsumerState1,
18501857

1851-
ConsumerOffset = osiris_log:next_offset(Segment1),
1858+
ConsumerOffset =
1859+
osiris_log:next_offset(Segment1),
18521860
ConsumerOffsetLag =
1853-
consumer_i(offset_lag, ConsumerState1),
1861+
consumer_i(offset_lag, ConsumerState1),
18541862

18551863
rabbit_log:debug("Subscription ~p is now at offset ~p with ~p message(s) "
18561864
"distributed after subscription",
1857-
[SubscriptionId, ConsumerOffset,
1865+
[SubscriptionId,
1866+
ConsumerOffset,
18581867
messages_consumed(ConsumerCounters1)]),
18591868

18601869
rabbit_stream_metrics:consumer_created(self(),
@@ -1867,10 +1876,10 @@ handle_frame_post_auth(Transport,
18671876
ConsumerOffsetLag,
18681877
Properties),
18691878
{Connection1#stream_connection{stream_subscriptions
1870-
=
1871-
StreamSubscriptions1},
1879+
=
1880+
StreamSubscriptions1},
18721881
State#stream_connection_state{consumers =
1873-
Consumers1}}
1882+
Consumers1}}
18741883
end
18751884
end
18761885
end;
@@ -1900,7 +1909,8 @@ handle_frame_post_auth(Transport,
19001909
SendFileOct)
19011910
of
19021911
{error, closed} ->
1903-
rabbit_log_connection:info("Stream protocol connection has been closed by peer", []),
1912+
rabbit_log_connection:info("Stream protocol connection has been closed by peer",
1913+
[]),
19041914
throw({stop, normal});
19051915
{{segment, Segment1}, {credit, Credit1}} ->
19061916
Consumer1 =

0 commit comments

Comments
 (0)