DEV: Avoid double deprecation warnings in dev (#21747)
This commit is contained in:
parent
d460309f89
commit
bd742de0b7
|
@ -977,14 +977,14 @@ module Discourse
|
||||||
|
|
||||||
raise Deprecation.new(warning) if raise_error
|
raise Deprecation.new(warning) if raise_error
|
||||||
|
|
||||||
STDERR.puts(warning) if Rails.env == "development"
|
STDERR.puts(warning) if Rails.env.development?
|
||||||
|
|
||||||
STDERR.puts(warning) if output_in_test && Rails.env == "test"
|
STDERR.puts(warning) if output_in_test && Rails.env.test?
|
||||||
|
|
||||||
digest = Digest::MD5.hexdigest(warning)
|
digest = Digest::MD5.hexdigest(warning)
|
||||||
redis_key = "deprecate-notice-#{digest}"
|
redis_key = "deprecate-notice-#{digest}"
|
||||||
|
|
||||||
if Rails.logger && !GlobalSetting.skip_redis? &&
|
if !Rails.env.development? && Rails.logger && !GlobalSetting.skip_redis? &&
|
||||||
!Discourse.redis.without_namespace.get(redis_key)
|
!Discourse.redis.without_namespace.get(redis_key)
|
||||||
Rails.logger.warn(warning)
|
Rails.logger.warn(warning)
|
||||||
begin
|
begin
|
||||||
|
|
Loading…
Reference in New Issue