]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/SharedKV.pm
treewide: kill problematic "$h->{k} //= do {" assignments
[public-inbox.git] / lib / PublicInbox / SharedKV.pm
index 398f4ca8dd70ef70af87ecf348689b6561c1532f..4297efedb05742a7cd222c993546768c75cbde8e 100644 (file)
@@ -15,7 +15,7 @@ use File::Path qw(rmtree make_path);
 
 sub dbh {
        my ($self, $lock) = @_;
-       $self->{dbh} //= do {
+       $self->{dbh} // do {
                my $f = $self->{filename};
                $lock //= $self->lock_for_scope_fast;
                my $dbh = DBI->connect("dbi:SQLite:dbname=$f", '', '', {
@@ -27,9 +27,6 @@ sub dbh {
                });
                my $opt = $self->{opt} // {};
                $dbh->do('PRAGMA synchronous = OFF') if !$opt->{fsync};
-               if (my $s = $opt->{cache_size}) {
-                       $dbh->do("PRAGMA cache_size = $s");
-               }
                $dbh->do('PRAGMA journal_mode = '.
                                ($opt->{journal_mode} // 'WAL'));
                $dbh->do(<<'');
@@ -39,7 +36,7 @@ CREATE TABLE IF NOT EXISTS kv (
        UNIQUE (k)
 )
 
-               $dbh;
+               $self->{dbh} = $dbh;
        }
 }