posthog-rails 3.12.0 → 3.12.2
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/posthog/rails/railtie.rb +10 -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: 62ff8f270eaa05f59e416c798a1788f8ce3baa16c1dcba8b09f58039a4ac52c6
|
|
4
|
+
data.tar.gz: 4bc7f6753ef7bd80fca9418c679085ae894441b5efcb06bd4d31348a30ec2ef7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 849ca061d5d4ce429e2361f22b89c95b1ee9e8f4ce2fb1462e841a5deaef896f38b4095335fa6aafa4a70d92a5b53218d08fb0772c4089d4117cb1639a4f0dcb
|
|
7
|
+
data.tar.gz: 2f117183afbf4ec5cce029afe3e4170739b1f52707c4465a2a3312891bf10cc2a0d0202c37622ea32e6ccae6d4e2e211057b8fdbe1851cdf66d33414de086a8e
|
|
@@ -38,8 +38,17 @@ module PostHog
|
|
|
38
38
|
# the core client exposing public readers.
|
|
39
39
|
PostHog::Rails::Logs::Setup.remember_client_options(options) if defined?(PostHog::Rails::Logs::Setup)
|
|
40
40
|
|
|
41
|
-
# Create the PostHog client
|
|
41
|
+
# Create the PostHog client. If a client already exists, shut it down
|
|
42
|
+
# after replacement so repeated init calls do not leave background
|
|
43
|
+
# resources from the previous instance running.
|
|
44
|
+
previous_client = @client
|
|
42
45
|
@client = PostHog::Client.new(options)
|
|
46
|
+
begin
|
|
47
|
+
previous_client&.shutdown
|
|
48
|
+
rescue StandardError => e
|
|
49
|
+
PostHog::Logging.logger.warn("Failed to shut down previous PostHog client: #{e.message}")
|
|
50
|
+
end
|
|
51
|
+
@client
|
|
43
52
|
end
|
|
44
53
|
|
|
45
54
|
# Define delegated methods using metaprogramming
|