move checkTasks near its usage

Related: https://pagure.io/koji/issue/2119
Fixes: https://pagure.io/koji/issue/2581
This commit is contained in:
Tomas Kopecek 2020-04-07 14:37:43 +02:00
parent 3f71076eba
commit d44af4cbb7

View file

@ -710,11 +710,6 @@ class RepoManager(object):
self.setTagScore(entry)
def updateRepos(self):
self.checkTasks()
self.logger.debug("Current tasks: %r" % self.tasks)
if self.other_tasks:
self.logger.debug("Found %i untracked newRepo tasks",
len(self.other_tasks))
self.logger.debug("Updating repos")
self.readCurrentRepos()
@ -873,6 +868,12 @@ class RepoManager(object):
def regenRepos(self):
"""Trigger newRepo tasks for needed tags"""
self.checkTasks()
self.logger.debug("Current tasks: %r" % self.tasks)
if self.other_tasks:
self.logger.debug("Found %i untracked newRepo tasks",
len(self.other_tasks))
# first note currently running tasks
running_tasks = 0
running_tasks_maven = 0