Getting this to work with FastAPI or another Async Backend
还没有人认领这个 Issue。
评估
调研方向
首先复现 issue 中所示的 FastAPI 设置,并检查 requests.post 附近的 LogDNAHandler 路径。确认执行在哪里发生阻塞,并确定从异步后端进行日志记录时的预期行为;当请求完成且不会使后端挂起,并且可以观察到 handler 的请求路径时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
When attempting to do this in my FastAPI backend. I am noticing that the request is getting blocked.
handler = LogDNAHandler(key='')
logging.getLogger().addHandler(handler)
logging.info("Checking to see if it works!")
Looking at the library. I included the print "Request Sent". It never gets printed, the request does not execute, the backend sits there and I need to restart the entire app.
try:
headers = {
'user-agent': self.user_agent,
'apikey': self.key
}
response = requests.post(url=self.url,
json=data,
params={
'hostname': self.hostname,
'ip': self.ip,
'mac': self.mac,
'tags': self.tags,
'now': int(time.time() * 1000)
},
stream=True,
allow_redirects=True,
timeout=self.request_timeout,
headers=headers)
print("Request Sent")
- 主要语言
- Python
- 星标
- 49
- 派生
- 36
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
logdna/python 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 25/100
-
enhancement
难度 4/5 3-5 天 新手友好度 20/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
anthropics/skills#1811 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
speaches-ai/speaches#678 ·
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
datalayer/mcp-compose#42 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
conda-forge/spacy-feedstock#177 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
UKGovernmentBEIS/inspect_evals#2523 ·