Updating templates takes too long
-
Hi,
for quite some time now – spanning several versions of Real Cookie Banner – I’ve been struggling with the following issue in one of my personal projects:
As soon as the plugin is activated, it attempts to update records in the
rcb_templatedatabase table. There are around 21,000 entries there, and the process never completes – even after a full day.The code responsible for this update is the
updateOutdated()function withinStorageHelper.php. I tried commenting out the specific line that performs the update to see what would happen. The result: as soon as I activate the plugin, another database statement kicks in, intended to clean up the data.This process is also located in
StorageHelper.php. Within thepersist()method, multipleDELETEstatements are apparently executed in a loop. That in itself isn’t a disaster, but why does this process never finish either? I’ve waited a full day multiple times, only for it to keep running endlessly.I decided to empty the
rcb_templatetable, which allowed me to activate the plugin without issues. However, at some point, it downloads the templates – again, around 21,000 of them. And once more, that last script starts running and just keeps going – endlessly.The biggest problem is that the entire website fails to load while the script is running. Every page request triggers the script execution. Consequently, I end up with dozens of these never-ending processes running in parallel.
I realize that this table holds the page templates the plugin uses to map functions to cookies – something obviously required to use the plugin. I’ve never encountered this issue with the plugin on other projects, so I suspect it might be due to a server-specific quirk (it’s my own server, so I have full access). However, the server is up to date, running MariaDB 10.11.14 and PHP 8.4.
The only way I can resolve the issue is by deactivating Real Cookie Banner. But that’s not my goal, after all ^^
What can I do to fix the problem? Any ideas? 🙂
You must be logged in to reply to this topic.