Пример #1
0
 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()
Пример #2
0
 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)
Пример #3
0
 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()
Пример #4
0
 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()
Пример #5
0
 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()]))
Пример #6
0
 def main(self):
     # Pool connections to speed up our job
     with Pool(processes=Threads().total()) as pool:
         pool.map(self.run, range(10000000))