Making WordPress.org


Ignore:
Timestamp:
04/29/2025 01:06:56 AM (9 months ago)
Author:
dd32
Message:

Theme Directory: Trac: Remove the retry logic for create/update tasks.

Reverts [14435].
Partially Reverts [14431].

See https://wordpress.slack.com/archives/C02QB8GMM/p1745814509983439

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/lib/class-trac.php

    r14435 r14439  
    6363        }
    6464
    65         $ok = $this->rpc_query_retry( 5, 'ticket.create', $subj, $desc, $attr );
     65        $ok = $this->rpc->query( 'ticket.create', $subj, $desc, $attr );
    6666        if ( ! $ok ) {
    6767            trigger_error( 'Trac: ticket.create: ' . $this->rpc->error->message, E_USER_WARNING );
     
    9898        }
    9999
    100         $ok = $this->rpc_query_retry( 5, 'ticket.update', $id, $comment, $attr, $notify );
     100        $ok = $this->rpc->query( 'ticket.update', $id, $comment, $attr, $notify );
    101101        if ( ! $ok ) {
    102102            trigger_error( 'Trac: ticket.update: ' . $this->rpc->error->message, E_USER_WARNING );
     
    115115     */
    116116    public function ticket_query( $search ) {
    117         $ok = $this->rpc->query( 'ticket.query', $search );
     117        $ok = $this->rpc_query_retry( 3, 'ticket.query', $search );
    118118        if ( ! $ok ) {
    119119            return false;
     
    163163
    164164            $ok = call_user_func_array( [ $this->rpc, 'query' ], $args );
    165 
    166             // Don't retry on creation tasks, if it's a HTTP timeout. Retry on other errors.
    167             if (
    168                 ! $ok &&
    169                 str_contains( $this->rpc->error->message, 'Operation timed out' ) &&
    170                 (
    171                     str_contains( $args[0], 'create' ) ||
    172                     str_contains( $args[0], 'update' )
    173                 )
    174             ) {
    175                 break;
    176             }
    177165        }
    178166
Note: See TracChangeset for help on using the changeset viewer.