posthog-rails 3.18.9 → 3.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/generators/posthog/templates/posthog.rb +10 -0
- data/lib/posthog/rails/railtie.rb +10 -0
- data/lib/posthog/rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 867622057310831537874be643cab04d6ffcd41df162d6b52e3262367e2e71bf
|
|
4
|
+
data.tar.gz: 4eb34539165b7b0642cecaf7016ba4139e5240a52fa13d074a78d4c81f94db68
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6d4228a629e25aed5e8b5af618fdbafd244f6d0bb6d2e8849f8e444abba640dfd96d063f49f2f20902ad0fb4a4b47736b3c9c28b2ce69cea9618397b37cf17e8
|
|
7
|
+
data.tar.gz: 14da23c275f3a973582a81508a333652db42b212fea2662b81744e5cda3ab51282db6d4664763080c9361ebac9395ecbd5092646e55c8f3c44ddaa82434e4120
|
|
@@ -134,6 +134,16 @@ PostHog.init do |config|
|
|
|
134
134
|
# Feature flag request timeout in seconds (default: 3)
|
|
135
135
|
config.feature_flag_request_timeout_seconds = 3
|
|
136
136
|
|
|
137
|
+
# Distributed flag definition cache (optional, for local evaluation)
|
|
138
|
+
# Share flag definitions across processes (Puma workers, Sidekiq, pods) via an
|
|
139
|
+
# external cache so only one process polls PostHog. Pass any object implementing
|
|
140
|
+
# the PostHog::FlagDefinitionCacheProvider interface. A Redis implementation is
|
|
141
|
+
# in the posthog-ruby repo under examples/redis_flag_cache.rb.
|
|
142
|
+
# config.flag_definition_cache_provider = RedisFlagCache.new(
|
|
143
|
+
# Redis.new(url: ENV.fetch('REDIS_URL')),
|
|
144
|
+
# service_key: "#{Rails.application.class.module_parent_name.underscore}-#{Rails.env}"
|
|
145
|
+
# )
|
|
146
|
+
|
|
137
147
|
# Error callback - called when PostHog encounters an error
|
|
138
148
|
# config.on_error = proc { |status, message|
|
|
139
149
|
# Rails.logger.error("[PostHog] Error #{status}: #{message}")
|
|
@@ -347,6 +347,16 @@ module PostHog
|
|
|
347
347
|
@base_options[:before_send] = value
|
|
348
348
|
end
|
|
349
349
|
|
|
350
|
+
# An object implementing the {PostHog::FlagDefinitionCacheProvider} interface so multiple
|
|
351
|
+
# Rails processes (Puma workers, Sidekiq, Kubernetes pods) can share flag definitions
|
|
352
|
+
# through an external cache instead of each polling PostHog independently.
|
|
353
|
+
#
|
|
354
|
+
# @param value [Object, nil]
|
|
355
|
+
# @return [Object, nil]
|
|
356
|
+
def flag_definition_cache_provider=(value)
|
|
357
|
+
@base_options[:flag_definition_cache_provider] = value
|
|
358
|
+
end
|
|
359
|
+
|
|
350
360
|
# @return [Hash] Core SDK options suitable for {PostHog::Client.new}.
|
|
351
361
|
def to_client_options
|
|
352
362
|
@base_options
|