]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/RemoveUnusedAvatars.php
Issue 11932: Restore SQL performance
[friendica.git] / src / Worker / RemoveUnusedAvatars.php
index 41a24325e745e610da58cb3e802dd6480f21e8c1..4591fb22bf5b7174a376b02b3d7487bd011f3be1 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -39,7 +39,7 @@ class RemoveUnusedAvatars
                                AND NOT `nurl` IN (SELECT `nurl` FROM `contact` WHERE `uid` != ?)
                                AND NOT `contact`.`id` IN (SELECT `author-id` FROM `post-user`)
                                AND NOT `contact`.`id` IN (SELECT `owner-id` FROM `post-user`)
-                               AND NOT `contact`.`id` IN (SELECT `causer-id` FROM `post-user`)
+                               AND NOT `contact`.`id` IN (SELECT `causer-id` FROM `post-user` WHERE `causer-id` IS NOT NULL)
                                AND NOT `contact`.`id` IN (SELECT `cid` FROM `post-tag`)
                                AND NOT `contact`.`id` IN (SELECT `contact-id` FROM `post-user`);";
 
@@ -56,7 +56,7 @@ class RemoveUnusedAvatars
                                        Logger::notice('We are outside of the maintenance window, quitting');
                                        return;
                                }
-                               Logger::notice('In removal', ['count' => $count, 'total' => $total]);
+                               Logger::info('In removal', ['count' => $count, 'total' => $total]);
                        }
                }
                DBA::close($contacts);