更新服务状态 Args: success: 操作是否成功 error: 错误信息
(self, success: bool, error: Exception = None)
| 272 | raise NotImplementedError("此邮箱服务不支持获取邮件内容") |
| 273 | |
| 274 | def update_status(self, success: bool, error: Exception = None): |
| 275 | """ |
| 276 | 更新服务状态 |
| 277 | |
| 278 | Args: |
| 279 | success: 操作是否成功 |
| 280 | error: 错误信息 |
| 281 | """ |
| 282 | if success: |
| 283 | self._status = EmailServiceStatus.HEALTHY |
| 284 | self._last_error = None |
| 285 | else: |
| 286 | self._status = EmailServiceStatus.DEGRADED |
| 287 | if error: |
| 288 | self._last_error = str(error) |
| 289 | |
| 290 | def __str__(self) -> str: |
| 291 | """字符串表示""" |
no outgoing calls
no test coverage detected