mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-07 00:37:22 +08:00
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. |
||
|---|---|---|
| .. | ||
| locales | ||
| shared_examples | ||
| backups_helpers.rb | ||
| bookmarkable_helper.rb | ||
| concurrency.rb | ||
| diagnostics_helper.rb | ||
| discourse_connect_support_helpers.rb | ||
| discourse_event_helper.rb | ||
| dom_matcher.rb | ||
| fake_bookmark_hashtag_data_source.rb | ||
| fake_logger.rb | ||
| fake_s3.rb | ||
| fast_image_helpers.rb | ||
| final_destination_helper.rb | ||
| helpers.rb | ||
| i18n_helpers.rb | ||
| imap_helper.rb | ||
| integration_helpers.rb | ||
| match_html_matcher.rb | ||
| mock_git_importer.rb | ||
| negated_matcher.rb | ||
| omniauth_helpers.rb | ||
| onebox_helpers.rb | ||
| problem_check_matcher.rb | ||
| rate_limit_matcher.rb | ||
| sample_plugin_site_settings.yml | ||
| service_matchers.rb | ||
| sidekiq_helpers.rb | ||
| site_settings_helpers.rb | ||
| system_helpers.rb | ||
| test_second_factor_action.rb | ||
| time_matcher.rb | ||
| topic_guardian_can_see_consistency_check.rb | ||
| ts_vector_matcher.rb | ||
| uploads_helpers.rb | ||
| webauthn_integration_helpers.rb | ||