Jump to content

cron for top pilots


RogerB

Recommended Posts

  • Moderators

HI Roger yes it wasn't specific to kACARS it was when any pirep was filed.

I tracked it down to the top pilot module, I think David was going to release a fix for it not sure if he updated or not yet.

Basically this is what i did, removed the listener >Core>Modules>TopPilot like this at the top section,


<?php
//by:simpilot
//www.simpilotgroup.com

class TopPilot extends CodonModule {

public $title = 'Top Pilots';

//public function __construct() {
// CodonEvent::addListener('TopPilot', array('pirep_filed'));
//}
public function EventListener($eventinfo) {
if($eventinfo[0] == 'pirep_filed') {
self::refresh_pilot_stats();
}
}

Then i put that function in to a php file in the admin directory,


<?php

define('ADMIN_PANEL', true);
include dirname(dirname(__FILE__)).'/core/codon.config.php';
Auth::$userinfo->pilotid = 0;
/*
error_reporting(E_ALL);
ini_set('display_errors', 'on');
*/
set_time_limit(0);
ini_set('memory_limit', '-1');

TopPilot::refresh_pilot_stats();
echo 'Top Pilot Stats Updated';

?>

Then set up the cron the same way as its usually run for maintenance.

php -f /srv/www/xxx/xxx/admin/YOUR_FILE_NAME.php

Just change the YOUR_FILE_NAME.php to whatever you call the file you create and should be good to go.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...