Selaa lähdekoodia

Turn on WALmode

George Baugh 7 kuukautta sitten
vanhempi
commit
8214a9646f
2 muutettua tiedostoa jossa 4 lisäystä ja 1 poistoa
  1. 1 0
      lib/Trog/Log/DBI.pm
  2. 3 1
      lib/Trog/SQLite.pm

+ 1 - 0
lib/Trog/Log/DBI.pm

@@ -39,6 +39,7 @@ sub log_message {
 
     my $res = $self->{sth}->execute($uuid, $date, $ip, $user, $method, $route, $code);
     $self->{sth2}->execute($uuid, $message) if $message;
+
     return $res;
 }
 

+ 3 - 1
lib/Trog/SQLite.pm

@@ -52,7 +52,9 @@ sub dbh {
     $dbh->{$schema} = $db;
 
     # Turn on fkeys
-    $db->do("PRAGMA foreign_keys = ON") or die "Could not enable foreign keys";
+    $db->do("PRAGMA foreign_keys = ON")  or die "Could not enable foreign keys";
+    # Turn on WALmode
+    $db->do("PRAGMA journal_mode = WAL") or die "Could not enable WAL mode";
     return $db;
 }