Fix build issue related to legacy aclk and new arch code (#11655)
* add idefs to protect regions of alerts code * remove check
Emmanuel Vasilakis committed
Oct 14, 2021 at 15:22 UTC
882bc018f3f128a3f825ce537e00952f84e013e6
1 file changed
+7
-2
database/sqlite/sqlite_aclk_alert.c
+7
-2
@@ -3,7 +3,7 @@
3
#include "sqlite_functions.h"
4
#include "sqlite_aclk_alert.h"
5
6
-#ifdef ENABLE_ACLK
6
+#ifdef ENABLE_NEW_CLOUD_PROTOCOL
7
#include "../../aclk/aclk_alarm_api.h"
8
#include "../../aclk/aclk.h"
9
#endif
@@ -15,12 +15,17 @@ void sql_queue_alarm_to_aclk(RRDHOST *host, ALARM_ENTRY *ae)
15
//check aclk architecture and handle old json alarm update to cloud
16
//include also the valid statuses for this case
17
#ifdef ENABLE_ACLK
18
+#ifdef ENABLE_NEW_CLOUD_PROTOCOL
19
if (!aclk_use_new_cloud_arch) {
20
+#endif
21
+
22
if ((ae->new_status == RRDCALC_STATUS_WARNING || ae->new_status == RRDCALC_STATUS_CRITICAL) ||
23
((ae->old_status == RRDCALC_STATUS_WARNING || ae->old_status == RRDCALC_STATUS_CRITICAL))) {
24
aclk_update_alarm(host, ae);
25
}
26
return;
27
+#endif
28
+#ifdef ENABLE_NEW_CLOUD_PROTOCOL
29
}
30
31
if (ae->flags & HEALTH_ENTRY_FLAG_ACLK_QUEUED)
@@ -92,7 +97,7 @@ bind_fail:
97
98
int rrdcalc_status_to_proto_enum(RRDCALC_STATUS status)
99
{
95
-#ifdef ENABLE_ACLK
100
+#ifdef ENABLE_NEW_CLOUD_PROTOCOL
101
switch(status) {
102
case RRDCALC_STATUS_REMOVED:
103
return ALARM_STATUS_REMOVED;