comparison scan.pl @ 255:b01560b95779

fixed cache time
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Mon, 17 Nov 2008 13:05:03 +0800
parents 1e4922d9a671
children 3b3f1306255a
comparison
equal deleted inserted replaced
254:1e4922d9a671 255:b01560b95779
120 } else { 120 } else {
121 $island = Ikariam::Island->insert($h_island); 121 $island = Ikariam::Island->insert($h_island);
122 } 122 }
123 123
124 # scanning the island 124 # scanning the island
125 # 10 minutes cache. 125 # 30 minutes cache.
126 if($island->time le (time - 60*10)) { 126 if($island->time le (time - 60*30)) {
127 my $i = $self->{ikariam}->clone(); 127 my $i = $self->{ikariam}->clone();
128 my @cities = 128 my @cities =
129 $i->viewIsland($h_island->{id}); 129 $i->viewIsland($h_island->{id});
130 $self->saveCities($h_island->{id}, @cities);
130 $island->set('time', time); 131 $island->set('time', time);
131 } 132 }
132 $island->update(); 133 $island->update();
133 134
134 $self->saveCities($h_island->{id}, @cities);
135 $pm->finish; 135 $pm->finish;
136 } 136 }
137 $pm->wait_all_children; 137 $pm->wait_all_children;
138 } 138 }
139 139