]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/ExpireConversations.php
Replace references to UTC_TIMESTAMP in SQL queries with a DateTimeFormat generated...
[friendica.git] / src / Worker / ExpireConversations.php
index fe0554a97876367072859664f3c5aea622f40dba..019b4e1085aaf438e662410b2a2935b543c41062 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
  *
@@ -23,6 +23,7 @@ namespace Friendica\Worker;
 
 use Friendica\Database\DBA;
 use Friendica\DI;
+use Friendica\Util\DateTimeFormat;
 
 class ExpireConversations
 {
@@ -36,7 +37,6 @@ class ExpireConversations
                        return;
                }
 
-               DBA::p("DELETE FROM `conversation` WHERE `received` < UTC_TIMESTAMP() - INTERVAL ? DAY", $days);
-
+               DBA::delete('conversation', ["`received` < ?", DateTimeFormat::utc('now - ' . $days . ' days')]);
        }
 }