(self)
| 114 | self.hash_md5_list.append(result["hash_md5"]) |
| 115 | |
| 116 | def save_mongo(self): |
| 117 | cnt = 0 |
| 118 | self.update_status("fetch content") |
| 119 | for result in self.results: |
| 120 | if not isinstance(result, GithubResult): |
| 121 | continue |
| 122 | |
| 123 | if result.hash_md5 in self.hash_md5_list: |
| 124 | continue |
| 125 | |
| 126 | # 保存md5, 直接在过滤前,避免重复过滤 |
| 127 | self.hash_md5_list.append(result.hash_md5) |
| 128 | hash_data = {"hash_md5": result.hash_md5, "github_scheduler_id": self.scheduler_id} |
| 129 | utils.conn_db("github_hash").insert_one(hash_data) |
| 130 | |
| 131 | if self.filter_result(result): |
| 132 | continue |
| 133 | |
| 134 | item = self.result_to_dict(result) |
| 135 | item["github_scheduler_id"] = self.scheduler_id |
| 136 | item["update_date"] = utils.curr_date_obj() |
| 137 | cnt += 1 |
| 138 | self.new_results.append(result) |
| 139 | utils.conn_db("github_monitor_result").insert_one(item) |
| 140 | |
| 141 | logger.info("github_monitor save {} {}".format(self.keyword, cnt)) |
| 142 | |
| 143 | def build_repo_map(self): |
| 144 | repo_map = dict() |
no test coverage detected