mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
d45682716b
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.
23 lines
525 B
Ruby
23 lines
525 B
Ruby
# frozen_string_literal: true
|
|
|
|
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
|
|
# error_count :integer default(0), not null
|
|
# first_error_at :datetime
|
|
#
|