- added new cronjob to delete expired signatures, closed #184

This commit is contained in:
Exodus4D
2016-08-30 20:12:21 +02:00
parent c9a792083d
commit 09cfc84619
3 changed files with 39 additions and 6 deletions

View File

@@ -10,21 +10,27 @@ instant = * * * * *
; run on EVE downtime 11:00 GMT/UTC
downtime = 0 11 * * *
; half hour (each 30min)
halfHour = */30 * * * *
[CRON.jobs]
; import system data (jump, kill,..) from CCP API
importSystemData = Cron\CcpSystemsUpdate->importSystemData, @hourly
importSystemData = Cron\CcpSystemsUpdate->importSystemData, @hourly
; disable outdated maps
deactivateMapData = Cron\MapUpdate->deactivateMapData, @hourly
deactivateMapData = Cron\MapUpdate->deactivateMapData, @hourly
; delete character log data
deleteLogData = Cron\CharacterUpdate->deleteLogData, @hourly
deleteLogData = Cron\CharacterUpdate->deleteLogData, @hourly
; delete disabled maps
deleteMapData = Cron\MapUpdate->deleteMapData, @downtime
deleteMapData = Cron\MapUpdate->deleteMapData, @downtime
; delete expired character cookie authentication data
deleteAuthenticationData = Cron\CharacterUpdate->deleteAuthenticationData, @downtime
deleteAuthenticationData = Cron\CharacterUpdate->deleteAuthenticationData, @downtime
; delete expired cache files
deleteExpiredCacheData = Cron\Cache->deleteExpiredData, @weekly
deleteExpiredCacheData = Cron\Cache->deleteExpiredData, @weekly
; delete expired signatures
deleteSignatures = Cron\MapUpdate->deleteSignatures, @halfHour

View File

@@ -67,4 +67,29 @@ class MapUpdate {
$log->write( sprintf(self::LOG_TEXT_MAPS, __FUNCTION__, $deletedMapsCount) );
}
/**
* delete all expired signatures on "inactive" maps
* >> php index.php "/cron/deleteSignatures"
* @param \Base $f3
*/
function deleteSignatures(\Base $f3){
$signatureExpire = (int)$f3->get('PATHFINDER.CACHE.EXPIRE_SIGNATURES');
if($signatureExpire > 0){
$pfDB = DB\Database::instance()->getDB('PF');
$sqlDeleteExpiredSignatures = "DELETE `sys` FROM
`system_signature` `sys` INNER JOIN
`system` ON
`system`.`id` = `sys`.`systemId`
WHERE
`system`.`active` = 0 AND
TIMESTAMPDIFF(SECOND, `sys`.`updated`, NOW() ) > :lifetime
";
$pfDB->exec($sqlDeleteExpiredSignatures, ['lifetime' => $signatureExpire]);
}
}
}

View File

@@ -110,6 +110,8 @@ CHARACTER_LOG = 300
CONSTELLATION_SYSTEMS = 2592000
; max expire time. Expired cache files will be deleted by cronjob (seconds) (default: 60d)
EXPIRE_MAX = 5184000
; expire time for signatures (inactive systems) (seconds). (default 3d)
EXPIRE_SIGNATURES = 259200
; LOGGING =========================================================================================
[PATHFINDER.LOGFILES]