[Serusers] [PATCH] add mysql reconnect option for ser-0.8.14

matteo brancaleoni mbrancaleoni at gmail.com
Wed Apr 20 15:05:59 CEST 2005


Hi, 
as many of you knows, mysql module on ser-0.8.14 (latest) lacks
the option to reconnect to the DB server if the server goes away
(ie server restarts, crash, blah).
With this simple patch, I backported the reconnect option of ser CVS,
along with the ping server option.

You can use these 2 module params:
-> modparam("mysql","auto_reconnect",1) 
// can be 0 or 1

-> modparam("mysql","ping_interval",60) 
// in seconds. if the connection has been idle for more than ping_interval, 
// the server will be pinged before the next query

There's another addition: since Mysql 5.03 the reconnect option
in the MySQL struct is disabled, so this patch takes
care also to enable this flag (this thing is not done by
the CVS version).

Hope can be of any help,
Matteo.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ser_mysql.diff
Type: text/x-patch
Size: 5803 bytes
Desc: not available
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20050420/a3ae9d7d/attachment.bin>


More information about the sr-users mailing list