WordPress.org

Forums

Football Pool
Cron job for "full calculations" ? (7 posts)

  1. sillery4ever
    Member
    Posted 2 years ago #

    Hello Antoine,

    Do you know if it s possible to run "full calculations" by a cran Job ... by night per exemple ?

    many thanks.

    http://wordpress.org/plugins/football-pool/

  2. AntoineH
    Member
    Plugin Author

    Posted 2 years ago #

    I don't think this is possible with the current version. The calculation runs entirely in the WordPress context with AJAX calls and calling it directly (e.g. via wget) won't work. But, to be honest, I am not an expert on the matter.

    WP also has its own cron system. I'll have a look at that, maybe I can use that and add this as an extra feature to the plugin.

  3. sillery4ever
    Member
    Posted 2 years ago #

    Is it possible for you to writ phpscript that call the "full calculations" task ? in order to place this phpfile in a Crop job ?

  4. AntoineH
    Member
    Plugin Author

    Posted 2 years ago #

    Well, I guess this should be possible, but it's not something that is high on my to-do list.

  5. sillery4ever
    Member
    Posted 2 years ago #

    ok thks

  6. sillery4ever
    Member
    Posted 2 years ago #

    Now i have 1000+ user.... smart calculations have a duration of 30min.

    I am looking for an idea to run a cron job each night.

    My serveur can execute some php file automatically. Could you tell me wich php file can i affect to the cron job to run automatically the smart calculation ?

    TY

  7. AntoineH
    Member
    Plugin Author

    Posted 2 years ago #

    As said before, I don't think it will work with the current version. But if you want to try something, here's some information about the inner working of the calculation.

    The file called is /admin/class-football-pool-admin-score-calculation.php. But you'll have to pass some variables to this file and wait for the script to finish before the next step can start.
    The /assets/admin/admin.js file contains the javascript code that handles the calls to this script (in multiple steps).

    The score calculation file can run in both AJAX mode and as a script that accepts the variables in the querystring (set constant FOOTBALLPOOL_RANKING_CALCULATION_NOAJAX to true in your wp-config.php).

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Football Pool
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.