Verified Commit f2933175 authored by Lauri Timmanee's avatar Lauri Timmanee
Browse files

Issue #3301573 by catch, ravi.shankar, mrinalini9, mherchel, lauriii,...

Issue #3301573 by catch, ravi.shankar, mrinalini9, mherchel, lauriii, alexpott, nod_, acbramley, nsciacca, kevinquillen, Chi: Remove the aggregate stale file threshold and state entry
parent 5bb2fc6b
Loading
Loading
Loading
Loading
+1 −13
Original line number Diff line number Diff line
@@ -143,19 +143,7 @@ public function getAll() {
   */
  public function deleteAll() {
    $this->state->delete('drupal_css_cache_files');

    $delete_stale = function ($uri) {
      $threshold = $this->configFactory
        ->get('system.performance')
        ->get('stale_file_threshold');
      // Default stale file threshold is 30 days.
      if ($this->time->getRequestTime() - filemtime($uri) > $threshold) {
        $this->fileSystem->delete($uri);
      }
    };
    if (is_dir('assets://css')) {
      $this->fileSystem->scanDirectory('assets://css', '/.*/', ['callback' => $delete_stale]);
    }
    $this->fileSystem->deleteRecursive('assets://css');
  }

  /**
+1 −12
Original line number Diff line number Diff line
@@ -158,18 +158,7 @@ public function getAll() {
   */
  public function deleteAll() {
    $this->state->delete('system.js_cache_files');
    $delete_stale = function ($uri) {
      $threshold = $this->configFactory
        ->get('system.performance')
        ->get('stale_file_threshold');
      // Default stale file threshold is 30 days.
      if ($this->time->getRequestTime() - filemtime($uri) > $threshold) {
        $this->fileSystem->delete($uri);
      }
    };
    if (is_dir('assets://js')) {
      $this->fileSystem->scanDirectory('assets://js', '/.*/', ['callback' => $delete_stale]);
    }
    $this->fileSystem->deleteRecursive('assets://js');
  }

  /**