X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=yarrg%2Fcommod-email-processor;h=0c16cd196f8e6f53268c6003a9015f8e33f8977e;hb=f97853ce6dc9df1caedecd2dac9530d53fdb844d;hp=bf42c0d65ef4b8344f29963de36080b35f664535;hpb=7d2fec305c9bdc622a41a343332331b25472fa20;p=ypp-sc-tools.db-live.git diff --git a/yarrg/commod-email-processor b/yarrg/commod-email-processor index bf42c0d..0c16cd1 100755 --- a/yarrg/commod-email-processor +++ b/yarrg/commod-email-processor @@ -25,25 +25,6 @@ # are used without permission. This program is not endorsed or # sponsored by Three Rings. -# Emails are: -# multipart/mixed, containing -# text/plain; name="metadata"; charset="utf-8" -# Content-Disposition: inline; filename="metadata" -# ocean\t canonical mixed case -# island\t canonical mixed case -# timestamp\t time_t (non-leap secs since start of 1970 UTC) -# clientname\t may contain spaces -# clientversion\t may contain spaces -# clientfixes\t space-delimited list -# clientspec\t \t\t -# servername\t may contain spaces -# serverversion\t may contain spaces -# serverfixes\t space-delimited list -# serverspec\t \t\t -# application/octet-stream; name="deduped.tsv.gz" -# Content-Disposition: attachment; filename="deduped.tsv.gz" -# - use strict (qw(vars)); use POSIX; @@ -117,7 +98,9 @@ sub main () { db_setocean($md{'ocean'}); my $dbfn= db_filename(); (stat $dbfn) or die "stat database $dbfn failed $!\n"; + db_writer(); db_connect(); + db_onconflict(sub { print STDERR "temporary failure: @_\n"; exit 75; }); my ($islandid) = $dbh->selectrow_array( "SELECT islands.islandid @@ -206,7 +189,7 @@ sub main () { pipethrough_run_finish($pt, 'gunzip <$deduped_tsv.gz'); - print "\n"; +# print "\n"; $dbh->commit(); # select * from ((buy natural join commods) natural join stalls) natural join islands;