| @@ 234-253 (lines=20) @@ | ||
| 231 | ) |
|
| 232 | ); |
|
| 233 | ||
| 234 | if ( false === $result ) { |
|
| 235 | // If no sitemap was generated, advance to the next type. |
|
| 236 | Jetpack_Sitemap_State::check_in( array( |
|
| 237 | 'sitemap-type' => $index_type, |
|
| 238 | 'last-added' => 0, |
|
| 239 | 'number' => 0, |
|
| 240 | 'last-modified' => '1970-01-01 00:00:00', |
|
| 241 | ) ); |
|
| 242 | ||
| 243 | if ( $this->logger ) { |
|
| 244 | $this->logger->report( "-- Cleaning Up $sitemap_type" ); |
|
| 245 | } |
|
| 246 | ||
| 247 | // Clean up old files. |
|
| 248 | $this->librarian->delete_numbered_sitemap_rows_after( |
|
| 249 | $state['number'], $sitemap_type |
|
| 250 | ); |
|
| 251 | ||
| 252 | return; |
|
| 253 | } |
|
| 254 | ||
| 255 | // Otherwise, update the state. |
|
| 256 | Jetpack_Sitemap_State::check_in( array( |
|
| @@ 328-346 (lines=19) @@ | ||
| 325 | ); |
|
| 326 | ||
| 327 | // If no index was built, advance to the next type and return. |
|
| 328 | if ( false === $result ) { |
|
| 329 | Jetpack_Sitemap_State::check_in( array( |
|
| 330 | 'sitemap-type' => $next_type, |
|
| 331 | 'last-added' => 0, |
|
| 332 | 'number' => 0, |
|
| 333 | 'last-modified' => '1970-01-01 00:00:00', |
|
| 334 | ) ); |
|
| 335 | ||
| 336 | if ( $this->logger ) { |
|
| 337 | $this->logger->report( "-- Cleaning Up $index_type" ); |
|
| 338 | } |
|
| 339 | ||
| 340 | // Clean up old files. |
|
| 341 | $this->librarian->delete_numbered_sitemap_rows_after( |
|
| 342 | $state['number'], $index_type |
|
| 343 | ); |
|
| 344 | ||
| 345 | return; |
|
| 346 | } |
|
| 347 | ||
| 348 | // Otherwise, check in the state. |
|
| 349 | Jetpack_Sitemap_State::check_in( array( |
|