game/_incl_data/crons/battle_clear.php
2023-01-10 18:30:35 +02:00

20 lines
983 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
use Core\Db;
require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'autoload.php';
/**
* Чистка и сброс счетчиков при отсутствии боев чтоб не ламался лог.
* Запуск каждые три часа в Х часов 20 минут?
*/
Db::sql('delete from battle_end where time < unix_timestamp() - 24 * 60 * 60');
Db::sql('delete from battle_last where time < unix_timestamp() - 24 * 60 * 60');
Db::sql('delete from battle_out where time < unix_timestamp() - 24 * 60 * 60');
Db::sql('delete from battle_stat where time < unix_timestamp() - 24 * 60 * 60');
Db::sql('delete from battle_logs where time < unix_timestamp() - 24 * 60 * 60');
Db::sql('delete from battle_logs_save where time < unix_timestamp() - 24 * 60 * 60');
Db::sql('delete from battle_users where time_enter between 1 and unix_timestamp() - 24 * 60 * 60');
Db::sql('delete from battle where time_over between 1 and unix_timestamp() - 24 * 60 * 60');