From: Michael R. <re...@eu...> - 2004-03-10 07:53:52
|
Hi Xavier, Nice to hear from you! > I've read the code of the plugin and I have one suggestion : I think the > plugin will be mostly used with a single MySQL server. > Maybe the user can set his server, user and pass once in the Variables, > and then call the mySQLquery() with only two arguments. There's a big > argument for this : > Using one persistent connection to the server will use less CPU and will > keep the plugin faster. Connecting to the server and disconnecting at > each refresh loop isn't clever and will make it lag. > > I propose you to connect to the server in plugin_mysql_init and don't > forget to disconnect in plugin_mysql_quit. Maybe you should introduce > some connection tracking : if the connection is lost (bad link, > overload, timeout), reconnect to the server. Good idea! Especially the persistent connection! For the variables I would choose a different approach: specify server, user and password directly in the config file, e.g. MySQL { Server 'foo.bar' User 'michael' Password 'swordfish' } To allow even more flexibility, the query() function could allow either two or five arguments, if there are two, use the values from the config file, if there are five, act like now. bye, Michael -- Michael Reinelt Tel: +43 676 3079941 Geisslergasse 4 Fax: +43 316 692343 A-8045 Graz, Austria e-mail: re...@eu... |