Skip to content

Commit ba4f77c

Browse files
Adicionar verificação de sucesso no processamento de certificado e log informativo correspondente
1 parent df9db1b commit ba4f77c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/application/process_certificate_notification.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ def execute(self, notifications: CertificateNotificationBatch) -> ProcessedCerti
3737

3838
if existing_certificate and len(existing_certificate) > 0:
3939
existing_certificate = existing_certificate[0]
40+
if existing_certificate.success:
41+
logger.info(f"Certificado já processado com sucesso: {existing_certificate.id}")
42+
continue
43+
4044
updated_certificate = self._update_certificate_with_notification(
4145
existing_certificate,
4246
notification
@@ -85,6 +89,7 @@ def _update_certificate_with_notification(
8589
Returns:
8690
Certificate: Certificado atualizado
8791
"""
92+
8893
# Atualiza os campos relacionados ao resultado do processamento
8994
certificate.success = notification.success
9095
certificate.certificate_key = notification.certificate_key

0 commit comments

Comments
 (0)