From 91984db2da728aaf884448b674b6988c574cab15 Mon Sep 17 00:00:00 2001 From: dizzy Date: Thu, 2 Sep 2021 17:32:44 -0700 Subject: try and reconnect database after running each scheduled task (at most once per two hours) during core:archive (#17949) --- core/CronArchive.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'core/CronArchive.php') diff --git a/core/CronArchive.php b/core/CronArchive.php index 453c21f6e5..e8e287d9ae 100644 --- a/core/CronArchive.php +++ b/core/CronArchive.php @@ -610,6 +610,11 @@ class CronArchive $this->disconnectDb(); + Piwik::addAction('ScheduledTasks.execute.end', function () { + // check if we need to reconnect after each task executes + $this->disconnectDb(); + }); + // TODO: this is a HACK to get the purgeOutdatedArchives task to work when run below. without // it, the task will not run because we no longer run the tasks through CliMulti. // harder to implement alternatives include: -- cgit v1.2.3