discourse/app/services/problem_check
Ted Johansson d446cc7318
FIX: Fix scheduled targeted problem checks (#35696)
Scheduled problem checks with multiple targets are not honouring the
`run_every` configuration.

For checks with multiple targets, all targets are checked in a single
instance of the problem check. However, we have one problem check
tracker per target.

This mismatch results in the `#ready_to_run?` method always creating a
tracker with no target when being checked.

This commit fixes that by:

**Expect checks to operate on a single target.**

This change makes it so that instances of a `ProblemCheck` class are
initialized with a target. So instead of 1-N we now have an N-N
relationship between checks and trackers.

Each instance can access their `target` through an attribute of the same
name.

This also means problem checks are back to returning a singular
`Problem` or `nil`, instead of `[Problem]` or `[]`.

For scheduled checks, this means that `ScheduleProblemChecks` now
enqueues `N` jobs (where `N` is the number of targets) per check instead
of `1` job per check.

**Update existing targeted checks to operate on a single target.**

This is essentially just removing the loop inside the check.
2025-11-10 10:09:14 +08:00
..
bad_favicon_url.rb DEV: Database backed admin notices (#26192) 2024-05-23 09:29:08 +08:00
email_polling_errored_recently.rb DEV: Database backed admin notices (#26192) 2024-05-23 09:29:08 +08:00
facebook_config.rb DEV: Database backed admin notices (#26192) 2024-05-23 09:29:08 +08:00
failing_emails.rb DEV: Database backed admin notices (#26192) 2024-05-23 09:29:08 +08:00
force_https.rb FIX: Fix scheduled targeted problem checks (#35696) 2025-11-10 10:09:14 +08:00
github_config.rb DEV: Database backed admin notices (#26192) 2024-05-23 09:29:08 +08:00
google_analytics_version.rb DEV: Database backed admin notices (#26192) 2024-05-23 09:29:08 +08:00
google_oauth2_config.rb DEV: Database backed admin notices (#26192) 2024-05-23 09:29:08 +08:00
group_email_credentials.rb FIX: Fix scheduled targeted problem checks (#35696) 2025-11-10 10:09:14 +08:00
host_names.rb DEV: Database backed admin notices (#26192) 2024-05-23 09:29:08 +08:00
image_magick.rb DEV: replace imagemagick convert commands with magick (#27767) 2024-07-08 16:55:59 +08:00
inline_problem_check.rb FIX: Don't clear inline problems when loading admin dashboard (#28220) 2024-08-05 11:45:55 +08:00
maxmind_db_configuration.rb DEV: Database backed admin notices (#26192) 2024-05-23 09:29:08 +08:00
missing_mailgun_api_key.rb DEV: Database backed admin notices (#26192) 2024-05-23 09:29:08 +08:00
out_of_date_themes.rb FIX: Fix broken out of date themes admin notice (#27916) 2024-07-15 16:12:44 +08:00
poll_pop3_auth_error.rb DEV: Database backed admin notices (#26192) 2024-05-23 09:29:08 +08:00
poll_pop3_timeout.rb DEV: Database backed admin notices (#26192) 2024-05-23 09:29:08 +08:00
problem.rb DEV: Support target in problem check problem constructor (#31922) 2025-03-24 10:10:41 +08:00
rails_env.rb DEV: Database backed admin notices (#26192) 2024-05-23 09:29:08 +08:00
ram.rb DEV: Database backed admin notices (#26192) 2024-05-23 09:29:08 +08:00
s3_backup_config.rb DEV: Database backed admin notices (#26192) 2024-05-23 09:29:08 +08:00
s3_cdn.rb DEV: Database backed admin notices (#26192) 2024-05-23 09:29:08 +08:00
s3_upload_config.rb DEV: Database backed admin notices (#26192) 2024-05-23 09:29:08 +08:00
sidekiq_check.rb DEV: Database backed admin notices (#26192) 2024-05-23 09:29:08 +08:00
starttls_disabled.rb FIX: actually disable SMTP starttls if the user is attempting to disable it 2025-11-04 23:42:14 -05:00
subfolder_ends_in_slash.rb DEV: Database backed admin notices (#26192) 2024-05-23 09:29:08 +08:00
translation_overrides.rb DEV: Database backed admin notices (#26192) 2024-05-23 09:29:08 +08:00
twitter_config.rb DEV: Database backed admin notices (#26192) 2024-05-23 09:29:08 +08:00
twitter_login.rb DEV: Database backed admin notices (#26192) 2024-05-23 09:29:08 +08:00
unreachable_themes.rb FIX: Fix broken out of date themes admin notice (#27916) 2024-07-15 16:12:44 +08:00
upcoming_change_stable_opted_out.rb FIX: Fix scheduled targeted problem checks (#35696) 2025-11-10 10:09:14 +08:00
watched_words.rb DEV: Database backed admin notices (#26192) 2024-05-23 09:29:08 +08:00