Fix:Error handling deployment
This commit is contained in:
parent
7d6f40237b
commit
b591a1e144
2 changed files with 11 additions and 2 deletions
|
|
@ -436,8 +436,17 @@ class BugReport(commands.Cog):
|
|||
|
||||
async def handle_deployment_complete(self, request):
|
||||
"""Notifie les demandeurs dont la fonctionnalité a été intégrée et attend le prochain déploiement."""
|
||||
try:
|
||||
try:
|
||||
await request.json()
|
||||
except Exception:
|
||||
try:
|
||||
raw_body = await request.text()
|
||||
if raw_body and raw_body.strip():
|
||||
json.loads(raw_body)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
for issue_iid, issue_data in list(self.issue_data.items()):
|
||||
if not issue_data.get("pending_deployment_notification"):
|
||||
continue
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ def run_mep_logic(author, commit_msg, branch="main"):
|
|||
# 4. Notifier le bot que le déploiement est terminé pour les issues en attente
|
||||
for attempt in range(6):
|
||||
try:
|
||||
requests.post("http://127.0.0.1:5001/deployment_complete", timeout=5)
|
||||
requests.post("http://127.0.0.1:5001/deployment_complete", json={}, timeout=5)
|
||||
break
|
||||
except Exception:
|
||||
if attempt < 5:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue