nso Voice
Joined: 25 Apr 2003 Posts: 19
|
Posted: Tue Sep 23, 2003 4:27 am Post subject: Looping timer that halts |
|
|
I've got a script that communicates with a vBB (virtual bulletin board) PHP forum.
When a scripted event occurs in the PHPscript, it stores a string to a file which the TCl checks every couple of seconds for new info.
The script works fine and dandy, but it seems like the timer halts sometimes.. It does not produce any errormessages, which I'm aware off. This can occur on totally random times, and I've been twisting my brain with this one, not being able to locate the problem.
The relevant code is here;
| Code: |
if {![info exists mytimer]} {
set mytimer [utimer 5 checksize]
}
proc checksize { } {
global logsize vbblogfile
set newsize [file size $vbblogfile]
if { $newsize == 0 } {
vbbtimer
return 0
}
if { [file size $vbblogfile] == $logsize } {
vbbtimer
return 0
} else {
set threadinfo [exec tail -n1 $vbblogfile]
[...]
putquick "privmsg $reportchan : "
putserv "privmsg $reportchan :$threadinfo"
set logsize $newsize
vbbtimer
return 0
}
}
proc vbbtimer { } {
utimer 5 checksize
}
|
Any bright ideas on what may be wrong ?
- nso |
|