mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: automatically expire bad push channels (#13156)
Previously we would retry push notifications indefinitely for all errors except for ExpiredSubscription Under certain conditions other persistent errors may arise such as a persistent rate limit. If we track more than 3 errors in a period of time longer than a day we will delete the subscription Also performs a bit of internal cleanup to ensure protected methods really are private.
This commit is contained in:
@@ -2,15 +2,21 @@
|
||||
|
||||
class PushSubscription < ActiveRecord::Base
|
||||
belongs_to :user
|
||||
|
||||
def parsed_data
|
||||
JSON.parse(data)
|
||||
end
|
||||
end
|
||||
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: push_subscriptions
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# user_id :integer not null
|
||||
# data :string not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# id :bigint not null, primary key
|
||||
# user_id :integer not null
|
||||
# data :string not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# error_count :integer default(0), not null
|
||||
# first_error_at :datetime
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user