]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/ClearCache.php
Merge pull request #10190 from annando/api-attached
[friendica.git] / src / Worker / ClearCache.php
index a1e78434c234631dc2229d2a7d44854c5352092f..5b71c2f8be328a281500ca423514157c6aec5aa8 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -37,9 +37,6 @@ class ClearCache
 
                // clear old cache
                DI::cache()->clear();
-               if (DI::config()->get('system', 'optimize_tables')) {
-                       DBA::e("OPTIMIZE TABLE `cache`");
-               }
 
                // clear old item cache files
                clear_cache();
@@ -66,14 +63,8 @@ class ClearCache
 
                // Delete the cached OEmbed entries that are older than three month
                DBA::delete('oembed', ["`created` < NOW() - INTERVAL 3 MONTH"]);
-               if (DI::config()->get('system', 'optimize_tables')) {
-                       DBA::e("OPTIMIZE TABLE `oembed`");
-               }
 
-               // Delete the cached "parse_url" entries that are older than three month
-               DBA::delete('parsed_url', ["`created` < NOW() - INTERVAL 3 MONTH"]);
-               if (DI::config()->get('system', 'optimize_tables')) {
-                       DBA::e("OPTIMIZE TABLE `parsed_url`");
-               }
+               // Delete the cached "parsed_url" entries that are expired
+               DBA::delete('parsed_url', ["`expires` < NOW()"]);
        }
 }