Only connect to newsserver if there are approved posts.

Signed-off-by: Thomas Hochstein <thh@thh.name>
This commit is contained in:
Thomas Hochstein 2026-01-31 22:39:28 +01:00
parent 9e5f72b7ea
commit 3680a37aaa
2 changed files with 4 additions and 1 deletions

View file

@ -4,6 +4,7 @@ huhu 0.11.0 (unreleased)
* Add shell to new huhu mod users. * Add shell to new huhu mod users.
* Add wrapper script for read-mail.pl * Add wrapper script for read-mail.pl
* Drop more headers. * Drop more headers.
* Only connect to newsserver if there are approved posts.
huhu 0.10 (unknown) huhu 0.10 (unknown)
* huhu reports version 0.09 (from MOD/Displaylib.pm), but has code * huhu reports version 0.09 (from MOD/Displaylib.pm), but has code

View file

@ -110,7 +110,6 @@ if ($sign_pgpmoose && DEBUG > 1)
print "News::Article::sign_pgpmoose enabled.\n"; print "News::Article::sign_pgpmoose enabled.\n";
} }
my Net::NNTP $nntp = connect_nntp(\%config);
my $dbi = MOD::DBIUtils->new(\%config) || my $dbi = MOD::DBIUtils->new(\%config) ||
die "Can't connect to database"; die "Can't connect to database";
@ -118,6 +117,9 @@ my $dbi = MOD::DBIUtils->new(\%config) ||
# i.e. all posts in the state 'moderated'. # i.e. all posts in the state 'moderated'.
my $dataref = $dbi->select_unposted(); my $dataref = $dbi->select_unposted();
# Only connect to newsserver if there are approved posts
my Net::NNTP $nntp = connect_nntp(\%config) if $dataref->rows;
#Schleife ueber alle selektierten Postings #Schleife ueber alle selektierten Postings
#Einlesen des Postings, Header anpassen,anschliessend posten #Einlesen des Postings, Header anpassen,anschliessend posten
#und das das posted-Bit in der Datenbank setzen. #und das das posted-Bit in der Datenbank setzen.