Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FSSDK-9951] add multi thread warning #345

Merged
merged 2 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ You can initialize the Optimizely instance in two ways: directly with a datafile
)
```

**Note:** The SDK spawns multiple threads when initialized. These threads have infinite loops that are used for fetching the datafile, as well as batching and dispatching events in the background. When using in a web server that spawn multiple child processes, you need to initialize the SDK after those child processes or workers have been spawned.

#### HTTP Config Manager

The `HTTPConfigManager` asynchronously polls for datafiles from a specified URL at regular intervals by making HTTP requests.
Expand Down
22 changes: 11 additions & 11 deletions lib/optimizely/event_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,17 @@ def get_common_params(project_config, user_id, attributes)
attributes&.each_key do |attribute_key|
# Omit attribute values that are not supported by the log endpoint.
attribute_value = attributes[attribute_key]
if Helpers::Validator.attribute_valid?(attribute_key, attribute_value)
attribute_id = project_config.get_attribute_id attribute_key
if attribute_id
visitor_attributes.push(
entity_id: attribute_id,
key: attribute_key,
type: CUSTOM_ATTRIBUTE_FEATURE_TYPE,
value: attribute_value
)
end
end
next unless Helpers::Validator.attribute_valid?(attribute_key, attribute_value)

attribute_id = project_config.get_attribute_id attribute_key
next unless attribute_id

visitor_attributes.push(
entity_id: attribute_id,
key: attribute_key,
type: CUSTOM_ATTRIBUTE_FEATURE_TYPE,
value: attribute_value
)
end
# Append Bot Filtering Attribute
if project_config.bot_filtering == true || project_config.bot_filtering == false
Expand Down
Loading