You are here

public function GatsbyFastbuildsCommands::delete in Gatsby Live Preview & Incremental Builds 2.0.x

Same name and namespace in other branches
  1. 8 modules/gatsby_fastbuilds/src/Commands/GatsbyFastbuildsCommands.php \Drupal\gatsby_fastbuilds\Commands\GatsbyFastbuildsCommands::delete()

Drush command that deletes all the Gatsby Fastbuilds Log entries.

@command gatsby_fastbuilds:delete @aliases gatsdel @usage gatsby_fastbuilds:delete

File

modules/gatsby_fastbuilds/src/Commands/GatsbyFastbuildsCommands.php, line 49

Class

GatsbyFastbuildsCommands
A drush command file.

Namespace

Drupal\gatsby_fastbuilds\Commands

Code

public function delete() {
  $time = time();
  $this->gatsbyLogger
    ->deleteExpiredLoggedEntities($time);

  // Store the log time in order to validate future syncs.
  $this->state
    ->set('gatsby_fastbuilds.last_logtime', $time);
}