Permalink
Browse files

Don't reload the torrents every time, they usually don't change

But instead have regen.sh restart hypnotoad
  • Loading branch information...
1 parent 8493122 commit 78876b737352ecae5f6957b58881c554b2d83484 @afresh1 committed Oct 15, 2012
Showing with 7 additions and 1 deletion.
  1. +3 −1 OpenBSDtracker
  2. +4 −0 regen.sh
View
@@ -40,7 +40,9 @@ helper torrents => sub {
state $ot_stats = WWW::Opentracker::Stats->new(
{ 'statsurl' => $baseurl . 'stats', } );
- my $torrents = app->ua->get('/torrent/torrents.json')->res->json || {};
+ state $torrents = {};
+ $torrents = app->ua->get('/torrent/torrents.json')->res->json
+ unless %{$torrents};
my $files = eval { $ot_stats->stats('tpbs')->{tpbs}->{files} };
warn $@ if $@;
View
@@ -31,6 +31,10 @@ cat ${OBT_DIR_TORRENT}/allowed.txt > /var/opentracker/whitelist
# torrentsync ALL=(_opentracker) NOPASSWD:/usr/bin/pkill -HUP opentracker
sudo -u _opentracker /usr/bin/pkill -HUP opentracker
+echo "Reload web server"
+# torrentsync ALL=(root) NOPASSWD: /usr/local/bin/hypnotoad /home/OpenBSDTorrents/OpenBSDtracker
+sudo /usr/local/bin/hypnotoad /home/OpenBSDTorrents/OpenBSDtracker
+
echo
echo ${OBT_DIR_HOME}/SeedTorrents.pl
${OBT_DIR_HOME}/SeedTorrents.pl

0 comments on commit 78876b7

Please sign in to comment.