Commit a2257328 authored by Erick Hitter's avatar Erick Hitter
Browse files

Better namespacing for machine-only commands

parent c7d43575
......@@ -69,5 +69,5 @@ require __DIR__ . '/wp-cli/class-cache.php';
require __DIR__ . '/wp-cli/class-events.php';
require __DIR__ . '/wp-cli/class-lock.php';
require __DIR__ . '/wp-cli/class-one-time-fixers.php';
require __DIR__ . '/wp-cli/class-orchestrate.php';
require __DIR__ . '/wp-cli/class-orchestrate-runner.php';
require __DIR__ . '/wp-cli/class-rest-api.php';
......@@ -147,4 +147,4 @@ class Orchestrate extends \WP_CLI_Command {
}
}
\WP_CLI::add_command( 'cron-control orchestrate', 'Automattic\WP\Cron_Control\CLI\Orchestrate' );
\WP_CLI::add_command( 'cron-control orchestrate runner', 'Automattic\WP\Cron_Control\CLI\Orchestrate' );
......@@ -159,7 +159,7 @@ func getSites() ([]Site, error) {
}
func getInstanceInfo() (SiteInfo, error) {
raw, err := runWpCliCmd([]string{"cron-control", "orchestrate", "get-info", "--format=json"})
raw, err := runWpCliCmd([]string{"cron-control", "orchestrate", "runner", "get-info", "--format=json"})
if err != nil {
return SiteInfo{}, err
}
......@@ -242,7 +242,7 @@ func queueSiteEvents(workerId int, sites <-chan Site, queue chan<- Event) {
}
func getSiteEvents(site string) ([]Event, error) {
raw, err := runWpCliCmd([]string{"cron-control", "orchestrate", "list-due-batch", fmt.Sprintf("--url=%s", site), "--format=json"})
raw, err := runWpCliCmd([]string{"cron-control", "orchestrate", "runner", "list-due-batch", fmt.Sprintf("--url=%s", site), "--format=json"})
if err != nil {
return make([]Event, 0), err
}
......@@ -257,7 +257,7 @@ func getSiteEvents(site string) ([]Event, error) {
func runEvents(workerId int, events <-chan Event) {
for event := range events {
subcommand := []string{"cron-control", "orchestrate", "run", fmt.Sprintf("--timestamp=%d", event.Timestamp), fmt.Sprintf("--action=%s", event.Action), fmt.Sprintf("--instance=%s", event.Instance), fmt.Sprintf("--url=%s", event.Url), fmt.Sprintf("--network=%d", wpNetwork)}
subcommand := []string{"cron-control", "orchestrate", "runner", "run", fmt.Sprintf("--timestamp=%d", event.Timestamp), fmt.Sprintf("--action=%s", event.Action), fmt.Sprintf("--instance=%s", event.Instance), fmt.Sprintf("--url=%s", event.Url), fmt.Sprintf("--network=%d", wpNetwork)}
runWpCliCmd(subcommand)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment