more good_job arguments, specs tolerate enqueuing user links
This commit is contained in:
@@ -1,6 +1,20 @@
|
||||
# typed: strict
|
||||
|
||||
unless Rails.env.test?
|
||||
START_PROMETHEUS_EXPORTER =
|
||||
T.let(
|
||||
# do not start in test or console mode
|
||||
(
|
||||
!Rails.env.test? && !Rails.const_defined?("Console") &&
|
||||
Rails.const_defined?("Server")
|
||||
) ||
|
||||
# always start in sever mode
|
||||
Rails.const_defined?("Server") ||
|
||||
# always start in worker mode
|
||||
(Rails.env == "worker"),
|
||||
T::Boolean,
|
||||
)
|
||||
|
||||
if START_PROMETHEUS_EXPORTER
|
||||
require "prometheus_exporter"
|
||||
require "prometheus_exporter/client"
|
||||
require "prometheus_exporter/metric"
|
||||
@@ -24,6 +38,7 @@ else
|
||||
# PrometheusExporter::Client is a singleton and we can't easily mock it out
|
||||
# in a test environment, and simply constructing a new instance attempts to
|
||||
# connect to a Prometheus server, which we can't rely on in a test environment.
|
||||
$stderr.puts "PrometheusExporter is disabled in test, console, and rake task environments"
|
||||
module PrometheusExporter
|
||||
class Client
|
||||
class RemoteMetric
|
||||
|
||||
Reference in New Issue
Block a user