C News fix for unstalled batching

Chip Salzenberg chip at ateng.com
Wed Nov 15 05:40:48 AEST 1989


One of the sites that we feed hasn't been keeping up with their batches.
In fact, they've fallen so far behind that entire batches that should be
100K are empty because all the articles in them have expired.

Unfortunately, the C News sendbatches program doesn't notice when an
outgoing batch is empty.  It sends it anyway.  Therefore, today the outgoing
queue to this problem site was full of 20 empty batches.  The fullness of
the outgoing queue prevented the enqueuing of any non-empty batches.

This patch should fix that bug.  It notices the size of an outgoing batch,
and if the batch is empty, it doesn't send it.

*** sendbatches.P	Tue Sep 19 14:36:45 1989
--- sendbatches	Tue Nov 14 13:28:48 1989
***************
*** 144,152 ****
  		for f in $them
  		do
! 			( $batcher -d $NEWSARTS $f | $muncher |
! 						$sender $sys ) >/tmp/nb$$ 2>&1
  			if test $? -eq 0 -a ! -s /tmp/nb$$
  			then
! 				rm -f $f /tmp/nb$$
  			else
  				(
--- 144,157 ----
  		for f in $them
  		do
! 			$batcher -d $NEWSARTS $f >/tmp/b$$
! 			if test ! -s /tmp/b$$
! 			then
! 				rm -f $f /tmp/b$$
! 				continue
! 			fi
! 			( $muncher | $sender $sys ) </tmp/b$$ >/tmp/nb$$ 2>&1
  			if test $? -eq 0 -a ! -s /tmp/nb$$
  			then
! 				rm -f $f /tmp/b$$ /tmp/nb$$
  			else
  				(

I hope this patch will meet with the approval of the C News Cabal -- er,
authors.  (Hey, yeah!  "C" stands for Cabal!  That's the ticket!)
-- 
You may redistribute this article only to those who may freely do likewise.
Chip Salzenberg at A T Engineering;  <chip at ateng.com> or <uunet!ateng!chip>



More information about the Comp.sources.bugs mailing list