Skip to content

Commit

Permalink
Merge pull request #1186 from alleyinteractive/feature/sync-publishin…
Browse files Browse the repository at this point in the history
…g-error

Restore incorrect change where a `push` could be sent synchronously
  • Loading branch information
renatonascalves authored Oct 17, 2024
2 parents 4ec4bad + 9443955 commit 6a4b79c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions admin/apple-actions/index/class-push.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function __construct( $settings, $id ) {
* @param boolean $doing_async Optional. Whether the action is being performed asynchronously.
* @param int $user_id Optional. The ID of the user performing the action. Defaults to the current user ID.
*
* @return boolean
* @return false|null
* @throws Action_Exception If the push fails.
*/
public function perform( $doing_async = false, $user_id = null ) {
Expand All @@ -95,9 +95,9 @@ public function perform( $doing_async = false, $user_id = null ) {
update_post_meta( $this->id, 'apple_news_api_pending', time() );

wp_schedule_single_event( time(), Admin_Apple_Async::ASYNC_PUSH_HOOK, [ $this->id, get_current_user_id() ] );
} else {
return $this->push( $user_id );
}

return $this->push( $user_id );
}

/**
Expand Down

0 comments on commit 6a4b79c

Please sign in to comment.