【发布时间】:2019-06-03 10:37:03
【问题描述】:
我有这样的简单同步代码:
import sentry_sdk
from time import sleep
sentry_sdk.init(MY_DSN)
while True:
# remove sentry breadcrumbs here, so they would not accumulate
try:
do_my_stuff()
except:
handle_my_exception()
sleep(some_non_linear_algorithm()) # I would like not to use crontab
当异常发生时,哨兵会捕获它和以前迭代的所有面包屑,所以我需要在每次迭代开始时删除所有当前的面包屑。但我在哨兵文档中找不到任何 API 来做到这一点。
【问题讨论】: