task/management/commands/runsamplingdownloader.py
Similar blocks of code found in 3 locations. Consider refactoring.import loggingSimilar blocks of code found in 3 locations. Consider refactoring.from time import sleepSimilar blocks of code found in 3 locations. Consider refactoring. Similar blocks of code found in 3 locations. Consider refactoring.from django.conf import settingsSimilar blocks of code found in 3 locations. Consider refactoring.from django.core.management.base import BaseCommandSimilar blocks of code found in 3 locations. Consider refactoring. Similar blocks of code found in 3 locations. Consider refactoring.from task.baidupcs import get_baidupcs_clientSimilar blocks of code found in 3 locations. Consider refactoring.from task.leecher import samplingSimilar blocks of code found in 3 locations. Consider refactoring.from task.models import TaskSimilar blocks of code found in 3 locations. Consider refactoring. Similar blocks of code found in 3 locations. Consider refactoring.logger = logging.getLogger("runsamplingdownloader")Similar blocks of code found in 3 locations. Consider refactoring. Similar blocks of code found in 3 locations. Consider refactoring. Similar blocks of code found in 3 locations. Consider refactoring.class Command(BaseCommand):Similar blocks of code found in 3 locations. Consider refactoring. help = "download sampling files."Similar blocks of code found in 3 locations. Consider refactoring. Similar blocks of code found in 3 locations. Consider refactoring. def add_arguments(self, parser):Similar blocks of code found in 3 locations. Consider refactoring. parser.add_argument(Similar blocks of code found in 3 locations. Consider refactoring. "--once",Similar blocks of code found in 3 locations. Consider refactoring. action="store_true",Similar blocks of code found in 3 locations. Consider refactoring. help="download for exists tasks and exit immediately.",Similar blocks of code found in 3 locations. Consider refactoring. )Similar blocks of code found in 3 locations. Consider refactoring. Similar blocks of code found in 3 locations. Consider refactoring. def handle(self, *args, **options):Similar blocks of code found in 3 locations. Consider refactoring. logger.info("sampling downlader started.")Similar blocks of code found in 3 locations. Consider refactoring. client = get_baidupcs_client()Similar blocks of code found in 3 locations. Consider refactoring. while True:Similar blocks of code found in 3 locations. Consider refactoring. for task in Task.filter_transferd():Similar blocks of code found in 3 locations. Consider refactoring. sampling(client, task)Similar blocks of code found in 3 locations. Consider refactoring. Similar blocks of code found in 3 locations. Consider refactoring. if options["once"]:Similar blocks of code found in 3 locations. Consider refactoring. returnSimilar blocks of code found in 3 locations. Consider refactoring. sleep(settings.RUNNER_SLEEP_SECONDS)