@@ -297,6 +297,20 @@ struct Router {
297297 try {
298298 auto routerConfig = loadRawTaoConfig (routerConfigFile);
299299
300+ // connectionTimeout
301+
302+ uint64_t newTimeoutUs = defaultConnectionTimeoutUs;
303+ if (routerConfig.get_object ().contains (" connectionTimeout" )) {
304+ newTimeoutUs = routerConfig.at (" connectionTimeout" ).get_unsigned () * 1'000'000 ;
305+ }
306+
307+ if (connectionTimeoutUs != newTimeoutUs) {
308+ connectionTimeoutUs = newTimeoutUs;
309+ LI << " Using connection timeout: " << (connectionTimeoutUs / 1'000'000 ) << " seconds" ;
310+ }
311+
312+ // load streamGroups
313+
300314 for (const auto &[groupName, spec] : routerConfig.at (" streams" ).get_object ()) {
301315 if (!streamGroups.contains (groupName)) {
302316 LI << " New stream group [" << groupName << " ]" ;
@@ -314,18 +328,6 @@ struct Router {
314328 for (const auto &[groupName, spec] : routerConfig.at (" streams" ).get_object ()) unneededGroups.erase (groupName);
315329 for (const auto &groupName : unneededGroups) streamGroups.erase (groupName);
316330 }
317-
318- // connectionTimeout
319-
320- uint64_t newTimeoutUs = defaultConnectionTimeoutUs;
321- if (routerConfig.get_object ().contains (" connectionTimeout" )) {
322- newTimeoutUs = routerConfig.at (" connectionTimeout" ).get_unsigned () * 1'000'000 ;
323- }
324-
325- if (connectionTimeoutUs != newTimeoutUs) {
326- connectionTimeoutUs = newTimeoutUs;
327- LI << " Using connection timeout: " << (connectionTimeoutUs / 1'000'000 ) << " seconds" ;
328- }
329331 } catch (std::exception &e) {
330332 LE << " Failed to parse router config: " << e.what ();
331333 if (!firstConfigLoadSuccess) ::exit (1 );
0 commit comments