From 3872d4850ca9ade0eccc8c7054b6459a1d00b25f Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 25 Jan 2021 19:39:58 -0700 Subject: gmi2email: don't record as seen if sending mail threw an exception Signed-off-by: Sean Whitton --- gmi2email | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'gmi2email') diff --git a/gmi2email b/gmi2email index f03c930..cae0767 100755 --- a/gmi2email +++ b/gmi2email @@ -158,18 +158,17 @@ sub send_subscribed_gemtext { } }; #>>> - $dbh->do("INSERT INTO seen VALUES (\"$uri\")"); - $mail and !$no_mail or return; if ($type =~ m{^text/gemini}) { gemtext_to_mail( $data, %to_mail_opts, gemlog => $gemlog // "unknown gemlog", link_title => $link_title, date => email_date $feed_date - )->send; + )->send if $mail and !$no_mail; } else { warn "$uri is not gemtext"; } + $dbh->do("INSERT INTO seen VALUES (\"$uri\")"); } sub gemini_fetch { -- cgit v1.2.3