@@ -710,6 +710,7 @@ hibernate(GS2State = #gs2_state { timeout_state = TimeoutState }) ->
710
710
711
711
pre_hibernate (GS2State = # gs2_state { state = State ,
712
712
mod = Mod }) ->
713
+ rabbit_event :stop_stats_timer (GS2State , # gs2_state .timer ),
713
714
case erlang :function_exported (Mod , handle_pre_hibernate , 1 ) of
714
715
true ->
715
716
case catch Mod :handle_pre_hibernate (State ) of
@@ -723,16 +724,17 @@ pre_hibernate(GS2State = #gs2_state { state = State,
723
724
end .
724
725
725
726
post_hibernate (GS2State = # gs2_state { state = State ,
726
- mod = Mod }) ->
727
+ mod = Mod ,
728
+ init_stats_fun = InitStatsFun }) ->
727
729
case erlang :function_exported (Mod , handle_post_hibernate , 1 ) of
728
730
true ->
729
731
case catch Mod :handle_post_hibernate (State ) of
730
732
{noreply , NState } ->
731
- process_next_msg (GS2State # gs2_state { state = NState ,
732
- time = infinity });
733
+ process_next_msg (InitStatsFun ( GS2State # gs2_state { state = NState ,
734
+ time = infinity }) );
733
735
{noreply , NState , Time } ->
734
- process_next_msg (GS2State # gs2_state { state = NState ,
735
- time = Time });
736
+ process_next_msg (InitStatsFun ( GS2State # gs2_state { state = NState ,
737
+ time = Time }) );
736
738
Reply ->
737
739
handle_common_termination (Reply , post_hibernate , GS2State )
738
740
end ;
@@ -743,7 +745,7 @@ post_hibernate(GS2State = #gs2_state { state = State,
743
745
% % still set to hibernate, iff that msg is the very msg
744
746
% % that woke us up (or the first msg we receive after
745
747
% % waking up).
746
- process_next_msg (GS2State # gs2_state { time = hibernate })
748
+ process_next_msg (InitStatsFun ( GS2State # gs2_state { time = hibernate }) )
747
749
end .
748
750
749
751
adjust_timeout_state (SleptAt , AwokeAt , {backoff , CurrentTO , MinimumTO ,
0 commit comments