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