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.

Are quicker log updates possible?

Old posts that have not been replied to for several years.
Locked
d
doobeh

Are quicker log updates possible?

Post by doobeh »

Hi,

I'm working on a small web-app that parses the channel log. I need to be able to have an up to date log, currently it seems it takes around 5 minutes before the log is updated, is there anyway to tune this down to a lower value (30seconds or lower ideally)

I realise it's not a config command, would anyone have any idea where the time to update is set in the source files, I've been having a dig around but to no avail as yet, hope you can help :]

Cheers!

-- Doobeh

"If we can't play God, who will?"
b
b34r
Voice
Posts: 35
Joined: Wed Jun 18, 2003 4:09 pm

Post by b34r »

This is in the config:

Code: Select all

# This could be good if you have had problem with the logfile filling
# your quota/hard disk or if you log +p and publish it to the web and
# need more up-to-date info. Note that this setting might increase the
# CPU usage of your bot (on the other hand it will decrease your mem usage).
set quick-logs 1
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

If you really want it to be every 30 seconds or so you could probably do it like this... (not tested)

Code: Select all

if {![info exists log_timer]} {
  set log_timer [utimer flush_logs 30]
}
proc flush_logs {} {
  global log_timer
  set log_timer [utimer flush_logs 30]
  foreach log [logfile] {
    foreach {mode chan file} $log {}
    logfile "" "" $file
    logfile $mode $chan $file
  }
}
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

stdragon wrote:If you really want it to be every 30 seconds or so you could probably do it like this... (not tested)

Code: Select all

if {![info exists log_timer]} {
  set log_timer [utimer flush_logs 30]
}
proc flush_logs {} {
  global log_timer
  set log_timer [utimer flush_logs 30]
  foreach log [logfile] {
    foreach {mode chan file} $log {}
    logfile "" "" $file
    logfile $mode $chan $file
  }
}
psst... format: utimer <interval> <command>

Also, I don't think you want an empty inner loop, would kinda defeat the purpose of looping at all.
Locked