Athena, instead of performing the optimization on every visit (this will get slower over time). Try catching the error and upon it performing an optimize.
PHP Code:
try{
// Code to run against sessions table
}catch ($e Exception){
OptimizeTable(sessions);
Show(please hold);
Redirect(URI);
}
I know that isn't proper code, but its from the top of my head. That "should" fix the problem. Though I don't have much experience with SMF, I have had to work around the corrupt tables thing for our Community/Social Networking engine many times.
Bookmarks