cache-html: Fractional sleep & run after cron
This commit is contained in:
parent
bed455039e
commit
9c16eba485
2 changed files with 6 additions and 2 deletions
|
|
@ -21,7 +21,7 @@
|
||||||
use v5.36;
|
use v5.36;
|
||||||
use FU::Pg;
|
use FU::Pg;
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
use Time::HiRes 'time';
|
use Time::HiRes 'time', 'sleep';
|
||||||
use Cwd 'abs_path';
|
use Cwd 'abs_path';
|
||||||
our $ROOT;
|
our $ROOT;
|
||||||
BEGIN { ($ROOT = abs_path $0) =~ s{/util/cache-html\.pl$}{}; }
|
BEGIN { ($ROOT = abs_path $0) =~ s{/util/cache-html\.pl$}{}; }
|
||||||
|
|
@ -33,7 +33,7 @@ my $verbose = 0;
|
||||||
my $delay = 0;
|
my $delay = 0;
|
||||||
my $batch = 1;
|
my $batch = 1;
|
||||||
my $maxbatches = 0;
|
my $maxbatches = 0;
|
||||||
GetOptions('verbose' => \$verbose, 'delay=i' => \$delay, 'batch=i' => \$batch, 'maxbatches=i' => \$maxbatches);
|
GetOptions('verbose' => \$verbose, 'delay=f' => \$delay, 'batch=i' => \$batch, 'maxbatches=i' => \$maxbatches);
|
||||||
|
|
||||||
my $conn = FU::Pg->connect($ENV{MANNED_PG}//'');
|
my $conn = FU::Pg->connect($ENV{MANNED_PG}//'');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,3 +12,7 @@ PSQL="psql -U manned -Awtq"
|
||||||
|
|
||||||
echo "============ Updating SQL indices"
|
echo "============ Updating SQL indices"
|
||||||
$PSQL -f update_indices.sql
|
$PSQL -f update_indices.sql
|
||||||
|
|
||||||
|
echo "============ Updating HTML cache"
|
||||||
|
test -f .config && source ./.config
|
||||||
|
./cache-html.pl --batch=5 --delay=0.5 --maxbatches=100
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue