-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Dispatcher to use Outbox #1186
base: add/outbox-collection
Are you sure you want to change the base?
Conversation
This is a simple rewrite of the current dispatcher system, to use the Outbox instead of the Scheduler. This is a first draft and will be improved over time, to better handle: * Re-tries * Errors * Logging * Batch processing
I'm going to take on some or all of those, let's see how far I get. |
@pfefferle I assume we need to get these tests passed? I'd really like this merged into #593 before I bring in my error/logging stuff |
* Initialize the class, registering WordPress hooks. | ||
*/ | ||
public static function init() { | ||
\add_action( 'activitypub_process_outbox', array( self::class, 'process_outbox' ), 10, 1 ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\add_action( 'activitypub_process_outbox', array( self::class, 'process_outbox' ), 10, 1 ); | |
\add_action( 'activitypub_process_outbox', array( self::class, 'process_outbox' ) ); |
Priority 10 and 1 accepted arg are defaults.
$outbox_item->post_status = 'publish'; | ||
\wp_update_post( $outbox_item ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$outbox_item->post_status = 'publish'; | |
\wp_update_post( $outbox_item ); | |
\wp_publish_post( $outbox_item ); |
I don't know if one is "better" than the other but I wanted to offer it
@@ -120,8 +120,7 @@ public function get_items( $request ) { | |||
'author' => $user_id > 0 ? $user_id : null, | |||
'paged' => $page, | |||
'post_type' => Outbox::POST_TYPE, | |||
'post_status' => 'draft', | |||
|
|||
'post_status' => 'any', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'post_status' => 'any', | |
'post_status' => 'any', | |
You don't want to keep the new line?
Simple dispatcher based on the Outbox-Collection.
This is a simple rewrite of the current dispatcher system, to use the Outbox instead of the Scheduler.
This is a first draft and will be improved over time, to better handle: