"""更新sitemap数据"""

import time

from django.core.management.base import BaseCommand

from talos.tasks.sitemap import sitemap


class Command(BaseCommand):

    def handle(self, *args, **options):
        """更新 sitemap 。"""

        print('------ starting -----')
        start_time = time.time()
        print("start at: ", start_time)

        sitemap()

        end_time = time.time()
        print("end at: ", end_time)
        print('total use {} s.'.format(end_time - start_time))
        print('Done!')
