From 0dc49a7a28b2f53739d66730e89381357c470dca Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Mon, 29 Mar 2021 18:52:39 +0200 Subject: [PATCH] mxq_daemon: Publish daemon prerequisites to database --- mxq_daemon.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mxq_daemon.c b/mxq_daemon.c index 724d8502..dea5086b 100644 --- a/mxq_daemon.c +++ b/mxq_daemon.c @@ -13,7 +13,7 @@ #include "mxq_daemon.h" -#define DAEMON_FIELDS_CNT 18 +#define DAEMON_FIELDS_CNT 19 #define DAEMON_FIELDS \ " daemon_id," \ " daemon_name," \ @@ -36,7 +36,8 @@ " UNIX_TIMESTAMP(daemon_start) as daemon_start," \ " UNIX_TIMESTAMP(daemon_stop) as daemon_stop," \ " daemon_flags," \ - " tags" + " tags," \ + " prerequisites" #undef _to_string #undef status_str @@ -79,6 +80,7 @@ static int bind_result_daemon_fields(struct mx_mysql_bind *result, struct mxq_da res += mx_mysql_bind_var(result, idx++, int32, &(daemon->daemon_flags)); res += mx_mysql_bind_var(result, idx++, string, &(daemon->tags)); + res += mx_mysql_bind_var(result, idx++, string, &(daemon->prerequisites)); return res; } @@ -143,7 +145,8 @@ int mxq_daemon_register(struct mx_mysql *mysql, struct mxq_daemon *daemon) " daemon_start = CURRENT_TIMESTAMP()," " daemon_stop = 0," " daemon_flags = ?," - " tags = ?" + " tags = ?," + " prerequisites = ?" ); if (!stmt) { mx_log_err("mx_mysql_statement_prepare(): %m"); @@ -170,6 +173,7 @@ int mxq_daemon_register(struct mx_mysql *mysql, struct mxq_daemon *daemon) res += mx_mysql_statement_param_bind(stmt, idx++, uint64, &(daemon->daemon_memory_limit_slot_hard)); res += mx_mysql_statement_param_bind(stmt, idx++, int32, &(daemon->daemon_flags)); res += mx_mysql_statement_param_bind(stmt, idx++, string, &(daemon->tags)); + res += mx_mysql_statement_param_bind(stmt, idx++, string, &(daemon->prerequisites)); assert(res ==0);