deeppavlov/utils/alexa/bot.py
def _refresh_valid_certs(self) -> None:
        """Conducts cleanup of periodical certificates with expired validation."""
        self.timer = Timer(REFRESH_VALID_CERTS_PERIOD_SECS, self._refresh_valid_certs)
        self.timer.start()

        expired_certificates = []

        for valid_cert_url, valid_cert in self.valid_certificates.items():
            valid_cert: ValidatedCert = valid_cert
            cert_expiration_time: datetime = valid_cert.expiration_timestamp
            if datetime.utcnow() > cert_expiration_time:
                expired_certificates.append(valid_cert_url)

        for expired_cert_url in expired_certificates:
            del self.valid_certificates[expired_cert_url]
            log.info(f'Validation period of {expired_cert_url} certificate expired')
def _refresh_valid_certs(self) -> None:
        """Conducts cleanup of periodical certificates with expired validation."""
        self.timer = Timer(REFRESH_VALID_CERTS_PERIOD_SECS, self._refresh_valid_certs)
        self.timer.start()

        expired_certificates = []

        for valid_cert_url, valid_cert in self.valid_certificates.items():
            valid_cert: ValidatedCert = valid_cert
            cert_expiration_time: datetime = valid_cert.expiration_timestamp
            if datetime.utcnow() > cert_expiration_time:
                expired_certificates.append(valid_cert_url)

        for expired_cert_url in expired_certificates:
            del self.valid_certificates[expired_cert_url]
            log.info(f'Validation period of {expired_cert_url} certificate expired')
Conducts cleanup of periodical certificates with expired validation.