code: def scan_index(content_dir):
      
  
      def scan_directory(root, files):
          """ Helper function to scan a single directory """
          try:
              for file in files:
                  fullpath = os.path.join(root, file)
                  relpath = os.path.relpath(fullpath, content_dir)
  
                  fingerprint = utils.file_fingerprint(fullpath)
                  last_fingerprint = get_last_fingerprint(fullpath)
                  if fingerprint != last_fingerprint and SCHEDULED_FILES.add(fullpath):
                      scan_file(fullpath, relpath, False)
          except:  # pylint:disable=bare-except
              logger.exception("Got error parsing directory %s", root)
  
      for root, _, files in os.walk(content_dir, followlinks=True):
          THREAD_POOL.submit(scan_directory, root, files)
  
      for table in (model.Entry, model.Category, model.Image, model.FileFingerprint):
          THREAD_POOL.submit(prune_missing, table)
docs: Scan all files in a content directory