def METHOD_NAME(ignore_errors,
                      filter,
                      username,
                      removeduplicates,
                      updatethumbnails):
    maps = Map.objects.all().order_by('title')
    if filter:
        maps = maps.filter(title__icontains=filter)
    if username:
        maps = maps.filter(owner__username=username)
    maps_count = maps.count()
    count = 0
    map_errors = []
    for map in maps:
        try:
            count += 1
            print(f"Syncing map {count}/{maps_count}: {map.title}")
            if updatethumbnails:
                print("Regenerating thumbnails...")
                create_gs_thumbnail(map, overwrite=True, check_bbox=False)
            if removeduplicates:
                # remove duplicates
                print("Removing duplicate links...")
                remove_duplicate_links(map)
        except (Exception, RuntimeError):
            map_errors.append(map.title)
            exception_type, error, traceback = sys.exc_info()
            print(exception_type, error, traceback)
            if ignore_errors:
                pass
            else:
                import traceback
                traceback.print_exc()
                print("Stopping process because --ignore-errors was not set and an error was found.")
                return
    print(f"There are {len(map_errors)} maps which could not be updated because of errors")
    for map_error in map_errors:
        print(map_error)