beetje messages om heuken

This commit is contained in:
Ward Wouts 2005-12-06 21:43:21 +00:00
parent 46f53182a3
commit 45d000b794

View file

@ -226,9 +226,7 @@ def get_articles(cachedir=false)
@connections[server]["first"] = first ? first.to_i : 0 @connections[server]["first"] = first ? first.to_i : 0
@connections[server]["last"] = last ? last.to_i : 0 @connections[server]["last"] = last ? last.to_i : 0
if Debuglevel > 0 if Debuglevel > 0
print " Server: #{server}\n" print " Server: #{server} First: #{first} Last: #{last}\n"
print " First: #{first}\n"
print " Last: #{last}\n"
end end
# clean up old newsrc entries # clean up old newsrc entries
if @connections[server]["first"] > 0 if @connections[server]["first"] > 0
@ -248,7 +246,7 @@ def get_articles(cachedir=false)
if @connections[server]["skip_ids"].max && @connections[server]["skip_ids"].max < @connections[server]["last"] if @connections[server]["skip_ids"].max && @connections[server]["skip_ids"].max < @connections[server]["last"]
articles = @connections[server]["last"] - @connections[server]["first"] articles = @connections[server]["last"] - @connections[server]["first"]
if articles > 10000 if articles > 10000
fillerend = (@connections[server]["skip_ids"].max - (articles/5)).to_i fillerend = (@connections[server]["skip_ids"].max - (articles/3)).to_i
else else
fillerend = @connections[server]["skip_ids"].max - 2000 fillerend = @connections[server]["skip_ids"].max - 2000
end end
@ -627,7 +625,6 @@ end
def group_is_complete(subj) def group_is_complete(subj)
group_subjects unless @grouped group_subjects unless @grouped
#print "Subject: #{subj}\n" #print "Subject: #{subj}\n"
print "length: #{@groups[subj]["messageinfo"].length} total: #{@groups[subj]["total"].to_i}\n" if Debuglevel > 1
messids = [] messids = []
@groups[subj]["messageinfo"].each {|x| @groups[subj]["messageinfo"].each {|x|
messids.push(x[:messid]) messids.push(x[:messid])
@ -721,10 +718,11 @@ def set_skip_ids(server, ids)
end end
def group_update_newsrc(subject) def group_update_newsrc(subject)
# print "running group_update_newsrc\n";
for i in (0...@groups[subject]["messageinfo"].length) for i in (0...@groups[subject]["messageinfo"].length)
if @connections[@groups[subject]["messageinfo"][i][:server]] if @connections[@groups[subject]["messageinfo"][i][:server]]
@connections[@groups[subject]["messageinfo"][i][:server]]["newsrc"].mark(@group, @groups[subject]["messageinfo"][i][:id]) @connections[@groups[subject]["messageinfo"][i][:server]]["newsrc"].mark(@group, @groups[subject]["messageinfo"][i][:id])
#p @group
#p @groups[subject]["messageinfo"][i][:id]
end end
end end
end end
@ -753,8 +751,7 @@ def cache_check(cachedir)
end end
def cache_read(cachedir) def cache_read(cachedir)
p "reading & scrubbing cache" puts "#{Time.now} Reading & scrubbing caches"
p Time.now
filename = "#{cachedir}/#{@group}.ripnewscache" filename = "#{cachedir}/#{@group}.ripnewscache"
excludes = {} excludes = {}
regexp = Regexp.new('^([^\|]*)\|([^\|]*)\|(.*)') regexp = Regexp.new('^([^\|]*)\|([^\|]*)\|(.*)')
@ -762,8 +759,7 @@ p Time.now
first = @connections[server]["first"] first = @connections[server]["first"]
last = @connections[server]["last"] last = @connections[server]["last"]
#cache_scrub(cachedir, server) #cache_scrub(cachedir, server)
puts " reading cache for #{server}" puts " #{Time.now} Reading cache for #{server}"
puts " #{Time.now}"
excludes[server] = {} excludes[server] = {}
@connections[server]["skip_ids"].elements.collect!{|x| excludes[server][x]=true} @connections[server]["skip_ids"].elements.collect!{|x| excludes[server][x]=true}
if FileTest.directory?( cachedir) and FileTest.file?( "#{filename}.#{server}" ) and FileTest.readable?( "#{filename}.#{server}" ) if FileTest.directory?( cachedir) and FileTest.file?( "#{filename}.#{server}" ) and FileTest.readable?( "#{filename}.#{server}" )
@ -785,14 +781,13 @@ puts " #{Time.now}"
end end
} }
if ( File.move("#{filename}.#{server}.new", "#{filename}.#{server}") ) if ( File.move("#{filename}.#{server}.new", "#{filename}.#{server}") )
print "Cache scrubbed for #{server}\n" print " #{Time.now} Cache scrubbed for #{server}\n"
else else
print "Couldn't scrub #{server} cache\n" print "Couldn't scrub #{server} cache\n"
end end
end end
end end
p "caches read" puts "#{Time.now} Caches read"
p Time.now
#memusage #memusage
end end