comparison skillbot.pl @ 63:27f9196fd610

Adding check for temporary API failures
author Dominic Cleal <dominic@computerkb.co.uk>
date Sat, 21 Feb 2009 01:03:33 +0000
parents f620582dee33
children 962dada7587e
comparison
equal deleted inserted replaced
62:f620582dee33 63:27f9196fd610
488 my $f = shift; 488 my $f = shift;
489 489
490 # Don't attempt updates during downtime, can cause crash 490 # Don't attempt updates during downtime, can cause crash
491 return if (timestamp_in_downtime(time)); 491 return if (timestamp_in_downtime(time));
492 492
493 my $skill = $f->{char_api}->skill->in_training; 493 my $char_skill = $f->{char_api}->skill;
494 # Sometimes this is undefined if there's an API error, try later
495 return unless defined $char_skill;
496
497 my $skill = $char_skill->in_training;
494 498
495 # Nothing training 499 # Nothing training
496 unless (defined $skill) 500 unless (defined $skill)
497 { 501 {
498 # If the char was training before and now has stopped then cancel 502 # If the char was training before and now has stopped then cancel