Skip to content

Commit 9ecdc7e

Browse files
committed
chore: address PR review comments on instance_id
1 parent f83c1db commit 9ecdc7e

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

libs/server-sdk/src/instance_id.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ namespace launchdarkly::server_side {
88

99
std::string MakeInstanceId() {
1010
// boost::uuids::random_generator emits a version 4 (random) UUID, which is
11-
// what the SCMP spec requires. The generator carries state (an internal
12-
// RNG), so constructing it on every call is fine for our use case where we
13-
// only call MakeInstanceId once per SDK instance.
11+
// what the SCMP spec requires. The generator carries state (an internal RNG
12+
// seeded from system entropy on construction), so we cache it per thread to
13+
// avoid redundant entropy draws on repeated calls.
1414
static thread_local boost::uuids::random_generator generator;
1515
return boost::uuids::to_string(generator());
1616
}

libs/server-sdk/src/instance_id.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ namespace launchdarkly::server_side {
99
* estimating server-connection-minutes when polling. The value is a v4 UUID
1010
* that is generated once per SDK instance and remains constant for the
1111
* lifetime of the client.
12-
*
13-
* See: sdk-specs / SCMP-server-connection-minutes-polling.
1412
*/
1513
inline constexpr char const* kInstanceIdHeader = "X-LaunchDarkly-Instance-Id";
1614

0 commit comments

Comments
 (0)