1: | <?php |
2: | |
3: | |
4: | |
5: | |
6: | |
7: | |
8: | namespace Aurora\Modules\Min; |
9: | |
10: | use Aurora\Api; |
11: | |
12: | require_once \dirname(__file__) . '/../../system/autoload.php'; |
13: | \Aurora\System\Api::Init(true); |
14: | |
15: | function Execute() |
16: | { |
17: | \Aurora\System\Api::Log('---------- Start remove expired hashes cron script', \Aurora\System\Enums\LogLevel::Full, 'cron-'); |
18: | |
19: | try { |
20: | |
21: | $minDecorator = Api::GetModuleDecorator('Min'); |
22: | if ($minDecorator) { |
23: | $minDecorator->DeleteExpiredHashes(\time()); |
24: | } |
25: | } catch(\Exception $e) { |
26: | \Aurora\System\Api::Log('Error during remove expired hashes cron script execution. ', \Aurora\System\Enums\LogLevel::Full, 'cron-'); |
27: | \Aurora\System\Api::LogException($e, \Aurora\System\Enums\LogLevel::Full, 'cron-'); |
28: | } |
29: | |
30: | \Aurora\System\Api::Log('---------- End remove expired hashes cron script', \Aurora\System\Enums\LogLevel::Full, 'cron-'); |
31: | } |
32: | |
33: | $iTimer = microtime(true); |
34: | |
35: | Api::skipCheckUserRole(true); |
36: | Execute(); |
37: | Api::skipCheckUserRole(false); |
38: | |
39: | \Aurora\System\Api::Log('Cron remove expired hashes execution time: ' . (microtime(true) - $iTimer) . ' sec.', \Aurora\System\Enums\LogLevel::Full, 'cron-'); |
40: | |