Skip to content
Snippets Groups Projects
Verified Commit 99b3bb2a authored by Andrej Ramašeuski's avatar Andrej Ramašeuski
Browse files

Indexer bugfix

parent 622cd058
Branches
Tags
No related merge requests found
...@@ -2,7 +2,7 @@ image: docker:19.03.12 ...@@ -2,7 +2,7 @@ image: docker:19.03.12
variables: variables:
DOCKER_TLS_CERTDIR: "/certs" DOCKER_TLS_CERTDIR: "/certs"
IMAGE_VER: 1.8.1 IMAGE_VER: 1.8.2
services: services:
- docker:19.03.12-dind - docker:19.03.12-dind
......
...@@ -5,12 +5,10 @@ use warnings; ...@@ -5,12 +5,10 @@ use warnings;
use FindBin qw($Bin); use FindBin qw($Bin);
use lib "$Bin/../lib"; use lib "$Bin/../lib";
use File::Copy; use File::Copy;
use Mojo::Pg;
use constant YAMDI => '/usr/bin/yamdi'; use constant YAMDI => '/usr/bin/yamdi';
#use PiTube::Schema;
use Mojo::Pg;
my $pg = Mojo::Pg->new my $pg = Mojo::Pg->new
->dsn($ENV{DB_DSN}) ->dsn($ENV{DB_DSN})
->username($ENV{DB_USERNAME}) ->username($ENV{DB_USERNAME})
...@@ -26,6 +24,7 @@ my $records = $pg->db->query(qq[ ...@@ -26,6 +24,7 @@ my $records = $pg->db->query(qq[
RECORD: RECORD:
while (my $record = $records->hash) { while (my $record = $records->hash) {
next RECORD if ! -f $record->{path}; next RECORD if ! -f $record->{path};
next RECORD if -f $record->{path} . '.idx';
print "Indexing $record->{path}\n"; print "Indexing $record->{path}\n";
...@@ -42,5 +41,4 @@ while (my $record = $records->hash) { ...@@ -42,5 +41,4 @@ while (my $record = $records->hash) {
{id => $record->{id}}, {id => $record->{id}},
); );
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment