(self, wl, url, batch_size, compare_helper)
| 110 | return self.helpers.rand_string(*args, **kwargs) |
| 111 | |
| 112 | async def do_mining(self, wl, url, batch_size, compare_helper): |
| 113 | for i in wl: |
| 114 | if i not in self.wl: |
| 115 | h = hash(i + url) |
| 116 | self.already_checked.add(h) |
| 117 | |
| 118 | results = set() |
| 119 | abort_threshold = 15 |
| 120 | try: |
| 121 | for group in self.helpers.grouper(wl, batch_size): |
| 122 | async for result, reasons, reflection in self.binary_search(compare_helper, url, group): |
| 123 | results.add((result, ",".join(reasons), reflection)) |
| 124 | if len(results) >= abort_threshold: |
| 125 | self.warning( |
| 126 | f"Abort threshold ({abort_threshold}) reached, too many {self.compare_mode}s found for url: {url}" |
| 127 | ) |
| 128 | results.clear() |
| 129 | assert False |
| 130 | except AssertionError: |
| 131 | pass |
| 132 | return results |
| 133 | |
| 134 | async def process_results(self, event, results): |
| 135 | url = event.data.get("url") |
no test coverage detected