From 7a98ef5fbfebdcc1d734274112e6edf55ff20846 Mon Sep 17 00:00:00 2001 From: franck cuny Date: Mon, 21 Dec 2009 22:01:43 +0100 Subject: fix timer --- lib/Lifestream.pm | 6 +----- lib/Lifestream/Worker.pm | 10 +++------- lifestream.pl | 3 +-- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/lib/Lifestream.pm b/lib/Lifestream.pm index c101ff1..cca6309 100644 --- a/lib/Lifestream.pm +++ b/lib/Lifestream.pm @@ -8,11 +8,7 @@ use Lifestream::Worker; our $VERSION = '0.01'; -has config => ( - is => "rw", - isa => "HashRef" -); - +has config => ( is => "rw", isa => "HashRef" ); has schema => ( is => 'ro', isa => 'Lifestream::Schema', diff --git a/lib/Lifestream/Worker.pm b/lib/Lifestream/Worker.pm index c22abcb..5718ad4 100644 --- a/lib/Lifestream/Worker.pm +++ b/lib/Lifestream/Worker.pm @@ -9,11 +9,7 @@ use Tatsumaki::HTTPClient; use Try::Tiny; use XML::Feed; -has config => ( - is => "rw", - isa => "HashRef" -); - +has config => ( is => "rw", isa => "HashRef" ); has schema => ( is => 'ro', isa => 'Lifestream::Schema', @@ -28,10 +24,10 @@ has schema => ( sub start { my $self = shift; my $t; - $t = AE::timer 0, 15, sub { + $t = AE::timer 0, 60, sub { + scalar $t; $self->fetch_feeds; }; - #$self->fetch_feeds(); } sub fetch_feeds { diff --git a/lifestream.pl b/lifestream.pl index faf20ea..88ca227 100644 --- a/lifestream.pl +++ b/lifestream.pl @@ -29,7 +29,7 @@ if ($deploy) { if ($add) { $schema->resultset('Feed')->create( { - feed_url => $url, + feed_url => $url, name => $name, profile_url => $profile, } @@ -38,7 +38,6 @@ if ($add) { if ($start) { my $app = Lifestream->app( config => LoadFile($config) ); - if ( $0 eq __FILE__ ) { require Tatsumaki::Server; Tatsumaki::Server->new( -- cgit 1.4.1