# Exception de travail : méthode non définie \`scheduled?' pour nil" erreur lors de la mention de la persona AI dans le post

**URL:** https://meta.discourse.org/t/job-exception-undefined-method-scheduled-for-nil-error-when-mentioning-ai-persona-in-post/324214
**Category:** Bug
**Tags:** ai
**Created:** [Août 30, 2024, 5:15 UTC](https://meta.discourse.org/t/job-exception-undefined-method-scheduled-for-nil-error-when-mentioning-ai-persona-in-post/324214 "2024-08-30T17:15:58Z")
**Posts on this page:** 1
**Showing post:** 9

<div class="post-metadata">

### Author: ![ted](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ted/32/283882_2.png) [@ted](https://meta.discourse.org/u/ted)
#### Post date: [Septembre 6, 2024, 8:56 UTC](https://meta.discourse.org/t/job-exception-undefined-method-scheduled-for-nil-error-when-mentioning-ai-persona-in-post/324214/9 "2024-09-06T08:56:51Z")

</div>

> [@MachineScholar](#):
>
> Cependant, `Job exception: undefined method `scheduled?’ for nil` a continué de s’accumuler (en hausse de 547 maintenant)

Cela se produit très probablement parce qu’il existe un suivi de vérification de problème, mais que la logique de vérification de problème n’est plus là. La façon la plus probable que cela se produise serait d’installer un plugin avec une vérification de problème, puis de le désinstaller. Le suivi serait alors toujours là, mais la logique de vérification manquerait.

J’ai une solution ici :

> <https://github.com/discourse/discourse/pull/28771>
>
> \### What is this change?
> 
> When running checks, we look to the existing problem… check trackers and try to grab their \`ProblemCheck\` classes.
> 
> In some cases this is no longer in the problem check repository, e.g. when the check was part of a plugin that has been uninstalled.
> 
> In the case where the check was scheduled, this would lead to an error in one of the jobs.
> 
> \### How does this fix it?
> 
> This fix has two parts:
> 
> 1. If a problem check tracker can't find it's \`ProblemCheck\` class, it destroys itself and any admin notices associated with it. It then returns \`nil\`.
> 2. The job that selects which checks to run now accounts for the fact that the \`ProblemCheck\` class could be \`nil\`, and filters it out of the run.
> 
> Bonus:
> 
> \- Scheduled checks now honour the \`enabled = false\` configuration, same as realtime checks.

---

_[View the full topic](https://meta.discourse.org/t/job-exception-undefined-method-scheduled-for-nil-error-when-mentioning-ai-persona-in-post/324214)._
