Consolidate transport related parameters into a struct.

Also, replace leftover cast with getMainConf().
This commit is contained in:
Pavel Pautov 2024-11-21 21:46:01 -08:00 committed by p-pautov
parent f633a8eef2
commit 88a64bb2c3
3 changed files with 20 additions and 11 deletions

View file

@ -576,10 +576,13 @@ ngx_int_t initWorkerProcess(ngx_cycle_t* cycle)
}
try {
Target target;
target.endpoint = std::string(toStrView(mcf->endpoint));
target.ssl = mcf->ssl;
target.trustedCert = mcf->trustedCert;
gExporter.reset(new BatchExporter(
toStrView(mcf->endpoint),
mcf->ssl,
mcf->trustedCert,
target,
mcf->batchSize,
mcf->batchCount,
mcf->resourceAttrs));
@ -772,7 +775,7 @@ void* createMainConf(ngx_conf_t* cf)
char* initMainConf(ngx_conf_t* cf, void* conf)
{
auto mcf = (MainConf*)conf;
auto mcf = getMainConf(cf);
ngx_conf_init_msec_value(mcf->interval, 5000);
ngx_conf_init_size_value(mcf->batchSize, 512);