Table of Contents |
---|
Purpose
This job limit the time of request being in status NEW or APPROVED. It changes status of person to preperson merge requests to EXPIRED after configured period of it existance.
Job logic
Job starts once in 24 hours 20 min by default (configured parameter MERGE_REQUEST_EXPIRATION_SCHEDULE= “*/20 * * * *”).
After starting it gets value from global parameter PERSON_TO_PREPERSON_ MERGE_REQUEST_TTLEXPIRATION_MINUTES (by default is 60 min).
Select all entries from mpiil.merge_person_preperson_requestrequests with status=NEW or APPROVED:
If inserted_at >= current_datetime() - PERSON_TO_PREPERSON_ MERGE_REQUEST_TTLEXPIRATION_MINUTES. Then skip the record
If inserted_at = < current_datetime() - PERSON_TO_PREPERSON_ MERGE_REQUEST_TTLEXPIRATION_MINUTES. Then update entry:
set status = EXPIRED
set updated_at = current_datetime()
set updated_by = system_user()
...