def main(self): # Pool connections to speed up our job with Pool(processes=Threads.get()) as pool: repos = [] for repo in self.repositories.get(): repos.append(repo) if len(repos) >= Threads.get(): function = partial(self.find) pool.map(function, repos) repos.clear()
def main(self): # Pool connections to speed up our job with Pool(processes=Threads.get()) as pool: if self.keywords.get(): self.search(pool) else: self.all(pool)
def all(self, pool): for repo in self.repositories.all(): self.repos.append(repo) if len(self.repos) >= Threads.get(): function = partial(self.find) pool.map(function, self.repos) self.repos.clear()
def search(self, pool): for keyword in self.keywords.get(): for repo in self.repositories.search(keyword): self.repos.append(repo.full_name) if len(self.repos) >= Threads.get(): function = partial(self.find) pool.map(function, self.repos) self.repos.clear()
def main(self): # Pool connections to speed up our job with Pool(processes=Threads.get()) as pool: while True: function = partial(self.find) pool.map(function, list(self.auth.get_repos()[:Threads.get()]))
def main(self): # Pool connections to speed up our job with Pool(processes=Threads().total()) as pool: pool.map(self.run, range(10000000))