| @@ 257-276 (lines=20) @@ | ||
| 254 | ) |
|
| 255 | ); |
|
| 256 | ||
| 257 | if ( false === $result ) { |
|
| 258 | // If no sitemap was generated, advance to the next type. |
|
| 259 | Jetpack_Sitemap_State::check_in( array( |
|
| 260 | 'sitemap-type' => $index_type, |
|
| 261 | 'last-added' => 0, |
|
| 262 | 'number' => 0, |
|
| 263 | 'last-modified' => '1970-01-01 00:00:00', |
|
| 264 | ) ); |
|
| 265 | ||
| 266 | if ( $this->logger ) { |
|
| 267 | $this->logger->report( "-- Cleaning Up $sitemap_type" ); |
|
| 268 | } |
|
| 269 | ||
| 270 | // Clean up old files. |
|
| 271 | $this->librarian->delete_numbered_sitemap_rows_after( |
|
| 272 | $state['number'], $sitemap_type |
|
| 273 | ); |
|
| 274 | ||
| 275 | return; |
|
| 276 | } |
|
| 277 | ||
| 278 | // Otherwise, update the state. |
|
| 279 | Jetpack_Sitemap_State::check_in( array( |
|
| @@ 351-369 (lines=19) @@ | ||
| 348 | ); |
|
| 349 | ||
| 350 | // If no index was built, advance to the next type and return. |
|
| 351 | if ( false === $result ) { |
|
| 352 | Jetpack_Sitemap_State::check_in( array( |
|
| 353 | 'sitemap-type' => $next_type, |
|
| 354 | 'last-added' => 0, |
|
| 355 | 'number' => 0, |
|
| 356 | 'last-modified' => '1970-01-01 00:00:00', |
|
| 357 | ) ); |
|
| 358 | ||
| 359 | if ( $this->logger ) { |
|
| 360 | $this->logger->report( "-- Cleaning Up $index_type" ); |
|
| 361 | } |
|
| 362 | ||
| 363 | // Clean up old files. |
|
| 364 | $this->librarian->delete_numbered_sitemap_rows_after( |
|
| 365 | $state['number'], $index_type |
|
| 366 | ); |
|
| 367 | ||
| 368 | return; |
|
| 369 | } |
|
| 370 | ||
| 371 | // Otherwise, check in the state. |
|
| 372 | Jetpack_Sitemap_State::check_in( array( |
|