Skip to content

Commit 7677329

Browse files
committed
fixes #55 adjusts order for failed task query
1 parent 44369fd commit 7677329

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/CLI.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,13 +399,23 @@ public function delete_failed( $args, $assoc_args ) {
399399

400400
}
401401

402+
/**
403+
* Retrieve the failed tasks within a given queue
404+
*
405+
* @param string $queue Name of the queue to retrieve failed tasks for
406+
*
407+
* @return \WP_Query
408+
* @access private
409+
*/
402410
private function get_failed_tasks( $queue ) {
403411

404412
$args = [
405413
'post_type' => self::POST_TYPE,
406414
'posts_per_page' => 999,
407415
'fields' => 'ids',
408416
'no_found_rows' => true,
417+
'order' => 'ASC',
418+
'orderby' => 'date',
409419
'tax_query' => [
410420
[
411421
'taxonomy' => self::TAXONOMY,
@@ -415,8 +425,7 @@ private function get_failed_tasks( $queue ) {
415425
],
416426
];
417427

418-
$tasks = new \WP_Query( $args );
419-
return $tasks;
428+
return new \WP_Query( $args );
420429

421430
}
422431

0 commit comments

Comments
 (0)