CleanExpiredAuthenticationFailures.php 906 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Integration\Cron;
  7. use Magento\Integration\Model\Oauth\Token\RequestLog\WriterInterface as RequestLogWriter;
  8. /**
  9. * Cron class for clearing log of outdated token request authentication failures.
  10. */
  11. class CleanExpiredAuthenticationFailures
  12. {
  13. /**
  14. * @var RequestLogWriter
  15. */
  16. private $requestLogWriter;
  17. /**
  18. * Initialize dependencies.
  19. *
  20. * @param RequestLogWriter $requestLogWriter
  21. */
  22. public function __construct(
  23. RequestLogWriter $requestLogWriter
  24. ) {
  25. $this->requestLogWriter = $requestLogWriter;
  26. }
  27. /**
  28. * Clearing log of outdated token request authentication failures.
  29. *
  30. * @return void
  31. */
  32. public function execute()
  33. {
  34. $this->requestLogWriter->clearExpiredFailures();
  35. }
  36. }