From da2580afdbde821bae55de506b12568650d472fb Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 19 Feb 2024 11:45:30 -0300 Subject: Flush picklog in asynchronous way whenever possible (anti-freeze) --- npc/003-3/malindou.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/npc/003-3/malindou.txt b/npc/003-3/malindou.txt index f3035f40c..2115bd3f8 100644 --- a/npc/003-3/malindou.txt +++ b/npc/003-3/malindou.txt @@ -1035,7 +1035,13 @@ OnInit: OnClock0500: if (gettime(GETTIME_DAYOFMONTH) >= 7) query_sql("DELETE FROM `chatlog` WHERE `time` < '"+sqldate(-7)+"'"); - query_sql("DELETE FROM `picklog` WHERE `time` < '"+sqldate(0, -1)+"'"); + // Flush picklog + if ($@HAS_API) { + query_sql("DELETE FROM `picklog` WHERE `time` < '"+sqldate(0, -1)+"'"); + } else { + apiasync("SQL", "DELETE FROM `picklog` WHERE `time` < '"+sqldate(0, -1)+"'"); + apiasync("SQLRUN", ""); + } // TODO: Have crontab make monthly .gz backup? // Remove overhead from picklog if (gettime(GETTIME_DAYOFMONTH) == 14) -- cgit v1.2.3-70-g09d2