[HSS] Modify where to check mongodb version (#2425)

This commit is contained in:
Sukchan Lee 2023-07-15 23:52:13 +09:00
parent 5c0c8ec4f2
commit 8535ceab8c
2 changed files with 2 additions and 4 deletions

View File

@ -352,12 +352,8 @@ int ogs_app_context_parse_config(void)
ogs_yaml_iter_bool(&parameter_iter);
} else if (!strcmp(parameter_key,
"use_mongodb_change_stream")) {
#if MONGOC_MAJOR_VERSION >= 1 && MONGOC_MINOR_VERSION >= 9
self.use_mongodb_change_stream =
ogs_yaml_iter_bool(&parameter_iter);
#else
self.use_mongodb_change_stream = false;
#endif
} else
ogs_warn("unknown key `%s`", parameter_key);
}

View File

@ -31,6 +31,7 @@ void hss_state_initial(ogs_fsm_t *s, ogs_event_t *e)
ogs_assert(s);
#if MONGOC_MAJOR_VERSION >= 1 && MONGOC_MINOR_VERSION >= 9
if (ogs_app()->use_mongodb_change_stream) {
ogs_dbi_collection_watch_init();
@ -41,6 +42,7 @@ void hss_state_initial(ogs_fsm_t *s, ogs_event_t *e)
OGS_FSM_TRAN(s, &hss_state_operational);
}
#endif
}
void hss_state_final(ogs_fsm_t *s, ogs_event_t *e)