I've developed an application using the codeigniter framework which
consumes tweets that are relevant to my search and puts them in a
database. The script works, but times out regularly, complaining that
"MySQL server has gone away". Under normal circumstances, I'd use
mysql_ping($conn) to remedy this and keep the connection alive.
However, the library does not use codeigniter. How would I ping the
mySQL connection codeigniter set up, and also where within the library
would I ping?
Thanks in advance,
John.
Ps: a copy of how the library is being used can be found here:
http://stikked.com/view/6959135
I'm not familiar with codeigniter itself, but I have ran across that
error message before a few times. There are a few causes, most of
which are discussed here:
If your stream is very quiet (ie: tweets only very occasionally) it
could be timing the MySQL connection out. You could always send an
arbitrary query to the server every 10 minutes or something (ie:
"SELECT CURRENT_TIMESTAMP()") just as a keep-alive.
Probably the easiest way to do this is put some code into
checkFilterPredicates() (which is called every 5 seconds) that checks
if you've done an "SQL PING" in the last 10 minutes. If you haven't,
do the ping, then reset the timer.
Good luck!
Cheers,
Fenn.
--
To unsubscribe, reply using "remove me" as the subject.