chiark
/
gitweb
/
~yarrgweb
/
ypp-sc-tools.db-live.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Take out lock in db-idempotent-populate too
[ypp-sc-tools.db-live.git]
/
yarrg
/
commod-email-processor
diff --git
a/yarrg/commod-email-processor
b/yarrg/commod-email-processor
index d2f0e819f6ef8c0f41626424fe13beb624d4f088..de68fbad98250c24cb43199cb1316e7dc4f79a0f 100755
(executable)
--- a/
yarrg/commod-email-processor
+++ b/
yarrg/commod-email-processor
@@
-49,6
+49,12
@@
use strict (qw(vars));
use POSIX;
use MIME::Parser;
use POSIX;
use MIME::Parser;
+BEGIN {
+ my $selfdir= $0;
+ $selfdir =~ s,/+[^/]*$,,;
+ chdir("$selfdir") or die "$selfdir $!";
+}
+
use Commods;
use CommodsDatabase;
use Commods;
use CommodsDatabase;
@@
-111,7
+117,9
@@
sub main () {
db_setocean($md{'ocean'});
my $dbfn= db_filename();
(stat $dbfn) or die "stat database $dbfn failed $!\n";
db_setocean($md{'ocean'});
my $dbfn= db_filename();
(stat $dbfn) or die "stat database $dbfn failed $!\n";
+ db_writer();
db_connect();
db_connect();
+ db_onconflict(sub { print STDERR "temporary failure: @_\n"; exit 75; });
my ($islandid) = $dbh->selectrow_array(
"SELECT islands.islandid
my ($islandid) = $dbh->selectrow_array(
"SELECT islands.islandid
@@
-200,7
+208,7
@@
sub main () {
pipethrough_run_finish($pt, 'gunzip <$deduped_tsv.gz');
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;
$dbh->commit();
# select * from ((buy natural join commods) natural join stalls) natural join islands;