BSL242 — Scheduled job handler¶
Summary¶
Scheduled job handler
Identifiers¶
| Field | Value |
|---|---|
| Rule code | BSL242 |
| Compatible alias | ScheduledJobHandler |
| Severity | ERROR |
| Enabled by default | Yes |
| Implemented | Yes |
| Tags | correctness, scheduled-jobs |
Behavior¶
- The public identifier
BSL242and aliasScheduledJobHandlerare stable. - The rule reports the cases documented on this page.
- Suppressions and project configuration are applied before publication.
- The rule requires neither an external analyzer nor network access.
Configuration and suppression¶
BSL### is the primary stable identifier. The compatible alias is accepted
in select, ignore, and compatible block suppression comments.
All three suppression families support both a current line and a range. When an opening comment follows code, it affects only that line. Use any one form:
noqa:
bsl-disable:
- compatible
BSLLSform:
When the same opening comment is on a line by itself, it starts a range. Close it with the matching marker from the same family:
// noqa: BSL242
// code without this diagnostic
// noqa-enable: BSL242
// bsl-disable: BSL242
// code without this diagnostic
// bsl-enable: BSL242
// BSLLS:ScheduledJobHandler-off
// code without this diagnostic
// BSLLS:ScheduledJobHandler-on
To disable the rule until the end of the file, omit the closing
noqa-enable, bsl-enable, or BSLLS:…-on marker.
Opening and closing markers must belong to the same family.
Description¶
Certain requirements are imposed on the methods of scheduled job handlers. Any export procedure or function of a non-global common server module can be used as a scheduled job method. If the scheduled job method is a function, then its return value is ignored.
If the scheduled job is predefined, then its handler should not have parameters. Otherwise, the parameters of such a scheduled job can be any values that are allowed to be sent to the server. The parameters of a scheduled job must exactly match the parameters of the procedure or function it calls.
Diagnostics checks the following signs of the correctness of the scheduled job handler method: - there is a common module and a shared module method specified as a handler - common module is server - the method is export - the method has no parameters if the scheduled job is predefined - method body is not empty - there are no other scheduled jobs that refer to the same handler method