Changeset 2668
- Timestamp:
- 03/02/2016 03:30:35 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments-network/includes/payment-requests-dashboard.php
r2666 r2668 571 571 $count = 0; 572 572 573 if ( false !== get_site_transient( '_wcb_jpm_checks_counter_lock' ) ) { 574 wp_die( 'JPM Checks Export is locked. Please try again later or contact support.' ); 575 } 576 577 // Avoid at least *some* race conditions. 578 set_site_transient( '_wcb_jpm_checks_counter_lock', 1, 30 ); 579 $start = absint( get_site_option( '_wcb_jpm_checks_counter', 0 ) ); 580 573 581 foreach ( $args['request_indexes'] as $index ) { 574 582 switch_to_blog( $index->blog_id ); … … 608 616 number_format( $amount, 2, '.', '' ), 609 617 $options['account_number'], 610 $ count, // must be globally unique?618 $start + $count, // must be globally unique? 611 619 $options['contact_email'], 612 620 $options['contact_phone'], … … 618 626 substr( $payable_to, 0, 35 ), 619 627 '', 620 $count, // vendor number. should be unique?628 sprintf( '%d-%d', $index->blog_id, $index->post_id ), 621 629 ), ',', '|' ); 622 630 … … 651 659 // File Trailer 652 660 fputcsv( $report, array( 'FILTRL', $count * 6 + 2 ), ',', '|' ); 661 662 // Update counter and unlock 663 $start = absint( get_site_option( '_wcb_jpm_checks_counter', 0 ) ); 664 update_site_option( '_wcb_jpm_checks_counter', $start + $count ); 665 delete_site_transient( '_wcb_jpm_checks_counter_lock' ); 653 666 654 667 fclose( $report );
Note: See TracChangeset
for help on using the changeset viewer.