Skip to content

Commit

Permalink
add start by default option to opt out of deprecated functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
cassidycodes committed Oct 8, 2024
1 parent 477d6e9 commit 9435bcd
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/graphql-hive.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ class Hive < GraphQL::Tracing::PlatformTracing
report_schema: true,
buffer_size: 50,
logger: nil,
collect_usage_sampling: 1.0
collect_usage_sampling: 1.0,
start_by_default: true
}.freeze

self.platform_keys = {
Expand Down Expand Up @@ -90,6 +91,14 @@ def initialize(options = {})
if opts[:report_schema] && @@schema
send_report_schema(@@schema)
end
if opts[:start_by_default]
@logger.warn("Deprecation warning: The default behavior of starting" \
"the usage reporter thread will be changed in future versions. " \
"Please set `start_by_default` to `false` and configure the " \
"GraphQL::Hive to call `on_start` when your server boots. See " \
"the README for more information.")
@usage_reporter.on_start
end
end
end

Expand Down

0 comments on commit 9435bcd

Please sign in to comment.