WordPress.org

Making WordPress.org


Ignore:
Timestamp:
04/04/2017 06:02:37 AM (2 years ago)
Author:
dd32
Message:

Plugin Directory: SVN Watcher: Don't re-register cron jobs on the init hook as it's too race-condititiony under load with Cavalcade.
Instead add a cron job to check the cronjobs are registered correctly, with a single event set to re-add svn watcher jobs when we know it's going to be marked as failed.

See #2678

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/class-svn-watcher.php

    r5234 r5235  
    7373                // Set it again, so if the next request fails, this exception will be thrown again, until the issue is resolved.
    7474                wp_cache_set( 'get_plugin_changes_between_failed', time(), 'svn-watch', 60 );
     75
     76                // Check the status of the cronjobs are sane, as the exception will trigger it to be marked as `failed`.
     77                wp_schedule_single_event( time() + 30, 'plugin_directory_check_cronjobs' );
    7578
    7679                throw new Exception( "Could not fetch plugins.svn logs: " . implode( ', ', $logs['errors'] ) );
     
    162165        $log = SVN::log( self::SVN_URL, 'HEAD' );
    163166        if ( $log['errors'] || ! $log['log'] ) {
     167            // Check the status of the cronjobs are sane, as the exception will trigger it to be marked as `failed`.
     168            wp_schedule_single_event( time() + 30, 'plugin_directory_check_cronjobs' );
     169
    164170            throw new Exception( "Unable to determine HEAD revision" );
    165171        }
Note: See TracChangeset for help on using the changeset viewer.