Next Pigs in Space 12

Things that suck: Manual repair when automated processes screw up

        has last_charge_date => ( ... );
        sub charge {
          my ($self, $event) = @_;
          my $now = $event->timestamp;
          CHARGE: until ($self->next_charge_date->follows($now)) {
              my $next = $self->next_charge_date;
              $self->charge_one_day($next);
              $self->last_charge_date($next);
              if ($self->is_expired) {
                $self->replacement->handle_event($event) if $self->replacement;
                last CHARGE;
              }
          }
        }

Next Copyright © 2013 M. J. Dominus