This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Problem with SQL and bot timing out

Old posts that have not been replied to for several years.
Locked
-
-W0kk3L-
Voice
Posts: 24
Joined: Sun Feb 23, 2003 7:23 pm

Problem with SQL and bot timing out

Post by -W0kk3L- »

Hi, i have a little problem....

I've created a script, which can be triggered from within a channel. It does a query on mysql, and dumps the results back to the channel where it was requested. The problem is that it can take up to 3 mins before mysql output the results. Meanwhile the eggdrop times out and restarts (on Quakenet).

Is there a way to fix this? I can't make the query go faster (large database), so is there a way to let the tcl standby until the query is done? (so other commands can be used in the meantime).

(I use Eggdrop v1.6.17 with mysql.mod compiled)
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

the proper way to fix this is to fix your database/queries - it shouldn't take 3 minutes to fetch data, never; use proper table indexing and refer to mysql docs on how to optimize that stuff

as last resort you can use the Thread package and rewrite your script to execute db queries in a separate thread, while allowing all normal processing to go on; however, you will need to recompile your TCL libs with --enable-threads
-
-W0kk3L-
Voice
Posts: 24
Joined: Sun Feb 23, 2003 7:23 pm

Post by -W0kk3L- »

I know the database could be better arranged, but currently i don't have a choice....

What is the difference between tcl81-threads and the tcl84 package?
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

the Thread package is not a built-in, neither with 8.1 nor with 8.4; you have to obtain it separately (check out sourceforge's tcl project), compile and install it under your tcl distribution
Locked