Skip to content
Permalink
Browse files
Prevent running scan_locs() more than once
  • Loading branch information
da2x committed Sep 7, 2015
1 parent f425710 commit 32e93e2c0bd1e6c6668e5f2ae8455e81941ac53f
Showing with 5 additions and 2 deletions.
  1. +5 −2 nikola/plugins/task/sitemap/__init__.py
@@ -140,6 +140,9 @@ def gen_tasks(self):
urlset = {}

def scan_locs():
# No need to run this more than once
if urlset:
return True
"""Scan site locations."""
for root, dirs, files in os.walk(output, followlinks=True):
if not dirs and not files and not kw['sitemap_include_fileless_dirs']:
@@ -290,6 +293,8 @@ def scan_locs_task():

return {'file_dep': file_dep}

scan_locs()

yield {
"basename": "_scan_locs",
"name": "sitemap",
@@ -298,8 +303,6 @@ def scan_locs_task():

yield self.group_task()

scan_locs()

for sitemap_path in sorted(urlset.keys()):
# TODO: Fix issue #1683
sitemap = urlset[sitemap_path]

0 comments on commit 32e93e2

Please sign in to comment.