ElkArte Community

Elk Development => Feature Discussion => Exterminated Features => Topic started by: emanuele on March 18, 2013, 04:28:02 pm

Title: Sort of maintenance during mod install
Post by: emanuele on March 18, 2013, 04:28:02 pm
A couple of days ago I was playing with a mod (https://github.com/MissAllSunday/PrivateTopic/pull/1) and since I changed the database table a bit I had to cover also the conversion of the db structure.
What I did on that specifica case is to check at install-time if the old column is there, and if so I put the forum in maintenance mode and redirect the user to a maintenance task, though that is a bit hackish I think...

I think it would be cool to have a way to split database operations (or even normal php code) when installing mods, a way to pause to avoid timeouts during long.
Something similar to the (scary :P) RepairBoards.php or similar.

Just a thought, no idea how to achieve it at the moment.
Title: Re: Sort of maintenance during mod install
Post by: Antechinus on March 18, 2013, 04:43:11 pm
Sounds like a good idea, in general.
Title: Re: Sort of maintenance during mod install
Post by: Arantor on March 18, 2013, 06:13:43 pm
That's sort of doable already - Niko did it for one of his mods, Project Tools, IIRC.

The big problem is when you have mods doing things like altering a very large table (e.g. messages) which can lead to 'MySQL has gone away' type issues.
Title: Re: Sort of maintenance during mod install
Post by: emanuele on March 18, 2013, 06:23:56 pm
Now that you made me think about it, it would probably just require a redirectexit in install.php to the maintenance task, then depending on things it would require to manually set up the "installation finished" page or completely ignore it and redirectexit again to some other scree, not a big issue though...

mmm...yeah, probably it's not necessary to make things more complex than they are now...
Title: Re: Sort of maintenance during mod install
Post by: Arantor on March 18, 2013, 06:35:19 pm
IIRC that was all Niko did - but most of the time it's no huge deal.

I would note that I did make a nod towards this by allowing plugins to insist on maintenance mode if they would be heavy (like altering the members or messages tables)