`notify_credentials` has 2 ways of running.
1. The manual, one-off method which uses `--args_from_database` to specify what should be sent.
2. [The automated method](7316111b35/openedx/core/djangoapps/credentials/management/commands/notify_credentials.py (L157-L159)), which runs on a regular schedule, to catch anything which fell through the cracks.
The automated method does a certain amount of time/date math in order to calculate the entry point of the window based on the current runtime. This is, I assume, why it has some hardcoded logic; it's not at all simple to have a `cron`-run management command running on a regular cadence that can do the same time logic.
```py
if options['auto']:
options['end_date'] = datetime.now().replace(minute=0, second=0, microsecond=0)
options['start_date'] = options['end_date'] - timedelta(hours=4)
```
However, it is not ideal that the actual time window of 4 hours is hardcoded directly into `edx-platform`.
This fix
* creates an overridable `NOTIFY_CREDENTIALS_FREQUENCY` that defaults to 14400 seconds (4 hours).
* pulls that frequency into the quoted code
Using seconds allows maximum flexibility.
FIXES: APER-3383
Status: Maintenance Responsibilities ================ The Credentials app is responsible (along with the `programs app`_) for communicating with the `credentials service`_, which is the system of record for a learner's Program Certificates, and which (when enabled by the edX instance) is the system of record for accessing all of a learner's credentials. .. _credentials service: https://github.com/openedx/credentials .. _programs app: https://github.com/openedx/edx-platform/tree/master/openedx/core/djangoapps/programs See Also ======== * ``lms/djangoapps/certificates`` * ``openedx/core/djangoapps/programs``