I don't understand why the bot cache is reloaded on cron. I've not seen a need for it. And the reload from the database is causing $conf variables set in settings.php to be lost. This removes the cache reloading.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

douggreen created an issue. See original summary.

douggreen’s picture

FileSize
1.36 KB
Morbus Iff’s picture

@douggreen: A normal Drupal webpage has the variable cache reloaded every page load. The always-on bot, however, is always-on, and the cache is NEVER reloaded. Thus, if someone goes to the Drupal site to add a new channel for the bot to join (or ANY other bot configuration), the always-on bot will NEVER see that configuration, because the variables have been cached in memory for, literally, forever. Requiring users to restart the bot for every configuration change, especially for large bots like Druplicon (which take about 30 minutes to rejoin all channels), is not palatable.

douggreen’s picture

OK. We need a better way to do this, because the current way loses settings.php $conf values.

douggreen’s picture

FileSize
1.99 KB

Attached is a new patch that maintains the variable reloading, but does it only for the bot_variables. It also won't lose any bot conf settings variables that aren't in the database. This solution fails, if a variable exists in the database and in settings.php because, in bootstrap, settings.php variables override database variables, but with this solution, database variables will override settings.php variables. But this is still better than the current solution, which completely loses all settings.php variables.

Ideally we need a hook to intercept before the variables are first loaded, save those in a global, and then the current variable_initialize() would work if it was passed the saved variables.

douggreen’s picture

FileSize
2.13 KB

Attached patch is almost identical, just with a changed function name and comment for better readability.