I'm coding a tcl script to dcc send files that users in channel trigger with a command. ie. !send file.txt
The script runs fine in and of itself. However, when the dccsend command is run it hogs 100% of the CPU for around 30 seconds... during that time, it wont respond to commands, etc.
Any reason for this?? Or is there a way i can avoid it?
Cause it could kill my bot if enough people tried to get files off it.
I've also tried using the after command - which has the same effect once it's triggered.
Code: Select all
set timeb [clock clicks -milliseconds]
dccsend $filepath $nick
set timec [clock clicks -milliseconds]
Result: timeb: 1302413656191 Timec: 1302413679132
TimeB - TimeC = 22,941 = 22.9 Seconds.
Any help would be appreciated.
Edit:
The file is around 1GB... i tried a much smaller file, and there wasn't as much lag.
So i checked the source code, and it seems there is code that can create a temporary copy of the file. I back tracked it in the source code, and eventually found the config setting "copy-to-tmp" which i then set to 0
Problem solved.
Regards,
TheVillageIdiot