You are here

public function DeveloperSyncController::schedule in Apigee Edge 8

Handler for 'apigee_edge.developer_sync.schedule'.

Runs a developer sync in the background.

Parameters

\Symfony\Component\HttpFoundation\Request $request: The HTTP request.

Return value

\Symfony\Component\HttpFoundation\RedirectResponse HTTP response doing a redirect.

1 string reference to 'DeveloperSyncController::schedule'
apigee_edge.routing.yml in ./apigee_edge.routing.yml
apigee_edge.routing.yml

File

src/Controller/DeveloperSyncController.php, line 107

Class

DeveloperSyncController
Controller for the developer synchronization-related pages.

Namespace

Drupal\apigee_edge\Controller

Code

public function schedule(Request $request) : RedirectResponse {
  $destination = $request->query
    ->get('destination');
  $job = new DeveloperSync(static::getFilter());
  $job
    ->setTag($this
    ->generateTag('background'));
  apigee_edge_get_executor()
    ->cast($job);
  $this
    ->messenger()
    ->addStatus($this
    ->t('Developer synchronization is scheduled.'));
  return new RedirectResponse($destination);
}