I have a procedure that performs every start of month to reset passwords for idle users. This procedure changes the user's password and sends an email notifying the new password.
However, I have different environments (local, homologation and production) and I want this to be executed only in production. I thought I would put a parameter in the system parameter table and check if the environment is production to be able to execute the procedure, but periodically restore the production base in other environments and this may not solve my problem.
Does anyone have a better solution for this?
Follow the code:
@Schedule(dayOfMonth="1", hour="2", persistent=false)
private void execute() throws BusinessException {
resetarSenhas();
}