Merge branch 'stable'
This commit is contained in:
		
						commit
						9a5bbb3463
					
				|  | @ -24,6 +24,7 @@ ERL_LIBS := $(ERL_LIBS):$(ELIXIR_LIB_DIR) | ||||||
| endif | endif | ||||||
| 
 | 
 | ||||||
| TEST_ERLC_OPTS += +nowarn_export_all | TEST_ERLC_OPTS += +nowarn_export_all | ||||||
|  | ERLC_OPTS += +nowarn_export_all | ||||||
| 
 | 
 | ||||||
| define compare_version | define compare_version | ||||||
| $(shell awk 'BEGIN { | $(shell awk 'BEGIN { | ||||||
|  |  | ||||||
|  | @ -708,8 +708,9 @@ hibernate(GS2State = #gs2_state { timeout_state = TimeoutState }) -> | ||||||
|     proc_lib:hibernate(?MODULE, wake_hib, |     proc_lib:hibernate(?MODULE, wake_hib, | ||||||
|                        [GS2State #gs2_state { timeout_state = TS }]). |                        [GS2State #gs2_state { timeout_state = TS }]). | ||||||
| 
 | 
 | ||||||
| pre_hibernate(GS2State = #gs2_state { state   = State, | pre_hibernate(GS2State0 = #gs2_state { state   = State, | ||||||
|                                       mod     = Mod }) -> |                                        mod     = Mod }) -> | ||||||
|  |     GS2State = maybe_stop_stats(GS2State0), | ||||||
|     case erlang:function_exported(Mod, handle_pre_hibernate, 1) of |     case erlang:function_exported(Mod, handle_pre_hibernate, 1) of | ||||||
|         true -> |         true -> | ||||||
|             case catch Mod:handle_pre_hibernate(State) of |             case catch Mod:handle_pre_hibernate(State) of | ||||||
|  | @ -722,8 +723,10 @@ pre_hibernate(GS2State = #gs2_state { state   = State, | ||||||
|             hibernate(GS2State) |             hibernate(GS2State) | ||||||
|     end. |     end. | ||||||
| 
 | 
 | ||||||
| post_hibernate(GS2State = #gs2_state { state = State, | post_hibernate(GS2State0 = #gs2_state { state = State, | ||||||
|                                        mod   = Mod }) -> |                                         mod   = Mod, | ||||||
|  |                                         init_stats_fun = InitStatsFun }) -> | ||||||
|  |     GS2State = InitStatsFun(GS2State0), | ||||||
|     case erlang:function_exported(Mod, handle_post_hibernate, 1) of |     case erlang:function_exported(Mod, handle_post_hibernate, 1) of | ||||||
|         true -> |         true -> | ||||||
|             case catch Mod:handle_post_hibernate(State) of |             case catch Mod:handle_post_hibernate(State) of | ||||||
|  | @ -1381,5 +1384,10 @@ emit_stats(GS2State = #gs2_state{queue = Queue}) -> | ||||||
|       #gs2_state.timer, emit_gen_server2_stats). |       #gs2_state.timer, emit_gen_server2_stats). | ||||||
| 
 | 
 | ||||||
| stop_stats(GS2State) -> | stop_stats(GS2State) -> | ||||||
|     _ = rabbit_event:stop_stats_timer(GS2State, #gs2_state.timer), |     maybe_stop_stats(GS2State), | ||||||
|     rabbit_core_metrics:gen_server2_deleted(self()). |     rabbit_core_metrics:gen_server2_deleted(self()). | ||||||
|  | 
 | ||||||
|  | maybe_stop_stats(#gs2_state{timer = undefined} = GS2State) -> | ||||||
|  |     GS2State; | ||||||
|  | maybe_stop_stats(GS2State) -> | ||||||
|  |     rabbit_event:stop_stats_timer(GS2State, #gs2_state.timer). | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue