dont extend popcorn timer for children (#11758)
Timotej S committed
Nov 5, 2021 at 12:42 UTC
6d0c55b7710c8d539d72ae6b915184d6b397e455
1 file changed
+12
-1
aclk/aclk.c
+12
-1
@@ -323,6 +323,17 @@ static int handle_connection(mqtt_wss_client client)
323
return 0;
324
}
325
326
+inline static int aclk_popcorn_check()
327
+{
328
+ ACLK_SHARED_STATE_LOCK;
329
+ if (unlikely(aclk_shared_state.agent_state == ACLK_HOST_INITIALIZING)) {
330
+ ACLK_SHARED_STATE_UNLOCK;
331
+ return 1;
332
+ }
333
+ ACLK_SHARED_STATE_UNLOCK;
334
+ return 0;
335
+}
336
+
337
inline static int aclk_popcorn_check_bump()
338
{
339
ACLK_SHARED_STATE_LOCK;
@@ -850,7 +861,7 @@ int ng_aclk_update_chart(RRDHOST *host, char *chart_name, int create)
861
{
862
struct aclk_query *query;
863
853
- if (aclk_popcorn_check_bump())
864
+ if (host == localhost ? aclk_popcorn_check_bump() : aclk_popcorn_check())
865
return 0;
866
867
query = aclk_query_new(create ? CHART_NEW : CHART_DEL);