Skip to content

Commit

Permalink
fix: duplicate orders save on cron (#3604)
Browse files Browse the repository at this point in the history
  • Loading branch information
leogermani authored Dec 12, 2024
1 parent 7c175d9 commit ec69167
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public static function get_order_duplicates( $cutoff_time, $current_page = 0, $r
* @param bool $save Whether to save the result as the option.
* @param bool $upsert Whether to upsert the option (merge with existing).
*/
public static function check_for_order_duplicates( $cutoff_time = DAY_IN_SECONDS, $save = false, $upsert = true ): array {
public static function check_for_order_duplicates( $cutoff_time = DAY_IN_SECONDS, $save = true, $upsert = true ): array {
$order_duplicates = self::get_order_duplicates( $cutoff_time );
if ( empty( $order_duplicates ) ) {
return [];
Expand Down Expand Up @@ -237,7 +237,7 @@ public static function cli_upsert_order_duplicates( $args, $assoc_args ) {
$cutoff_time = strtotime( $cutoff_time_str ) - time();
$save_as_option = isset( $assoc_args['save'] ) ? $assoc_args['save'] : false;

$duplicates = self::check_for_order_duplicates( $cutoff_time, $save_as_option, false );
$duplicates = self::check_for_order_duplicates( $cutoff_time, $save_as_option );

if ( empty( $duplicates ) ) {
\WP_CLI::success( 'No duplicate orders found.' );
Expand Down

0 comments on commit ec69167

Please sign in to comment.