Changeset d69c37c


Ignore:
Timestamp:
Oct 11, 2009, 10:17:52 PM (12 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
7424a5b
Parents:
36546fa
git-author:
Nelson Elhage <nelhage@mit.edu> (10/06/09 00:18:42)
git-committer:
Nelson Elhage <nelhage@mit.edu> (10/11/09 22:17:52)
Message:
Fix timeouts when we encounter errors.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/BarnOwl/Module/Twitter/Handle.pm

    r36546fa rd69c37c  
    131131    unless(defined($ratelimit) && ref($ratelimit) eq 'HASH') {
    132132        # Twitter's probably just sucking, try again later.
    133         $self->sleep(5);
     133        $self->sleep(5*60);
    134134        return;
    135135    }
     
    137137    if(exists($ratelimit->{remaining_hits})
    138138       && $ratelimit->{remaining_hits} <= 0) {
    139         $self->sleep(time - $ratelimit->{reset_time_in_seconds} + 60);
     139        $self->sleep($ratelimit->{reset_time_in_seconds} - time + 60);
    140140        die("Twitter: ratelimited until " . $ratelimit->{reset_time} . "\n");
    141141    } elsif(exists($ratelimit->{error})) {
Note: See TracChangeset for help on using the changeset viewer.