Skip to content

Commit

Permalink
Merge pull request #23 from jrfnl/Bug-fix-cache
Browse files Browse the repository at this point in the history
Bug fix: Prevent lots of unnecessary metadata cache writes.
  • Loading branch information
YahnisElsts committed Jan 7, 2015
2 parents 2322275 + 18138dd commit 5068727
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions includes/Wpup/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,13 @@ public static function fromArchive($filename, $slug = null, Wpup_Cache $cache =
throw new Wpup_InvalidPackageException( sprintf('The specified file %s does not contain a valid WordPress plugin or theme.', $filename));
}
$metadata['last_updated'] = gmdate('Y-m-d H:i:s', $modified);

//Update cache.
if ( isset($cache) ) {
$cache->set($cacheKey, $metadata, self::$cacheTime);
}
}

//Update cache.
if ( isset($cache) ) {
$cache->set($cacheKey, $metadata, self::$cacheTime);
}
if ( $slug === null ) {
$slug = $metadata['slug'];
}
Expand Down

0 comments on commit 5068727

Please sign in to comment.