mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Add DB backed problem checks to support perform_every config (#25834)
As part of problem checks refactoring, we're moving some data to be DB backed. In this PR it's the tracking of problem check execution. When was it last run, when was the last problem, when should it run next, how many consecutive checks had problems, etc. This allows us to implement the perform_every feature in scheduled problem checks for checks that don't need to be run every 10 minutes.
This commit is contained in:
16
db/migrate/20240223052820_create_problem_check_trackers.rb
Normal file
16
db/migrate/20240223052820_create_problem_check_trackers.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateProblemCheckTrackers < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
create_table :problem_check_trackers do |t|
|
||||
t.string :identifier, null: false, index: { unique: true }
|
||||
|
||||
t.integer :blips, null: false, default: 0
|
||||
|
||||
t.datetime :last_run_at
|
||||
t.datetime :next_run_at
|
||||
t.datetime :last_success_at
|
||||
t.datetime :last_problem_at
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user