carl: add check_status method checking if Carl is up (#88345) #498

Merged
yweber merged 1 commits from wip/88345-carl-check-status into main 2024-03-21 10:41:58 +01:00
Owner
No description provided.
yweber added 1 commit 2024-03-19 16:12:33 +01:00
gitea/passerelle/pipeline/head This commit looks good Details
3338738767
carl: add check_status method checking if Carl is up (#88345)
yweber changed title from WIP: carl: add check_status method checking if Carl is up (#88345) to carl: add check_status method checking if Carl is up (#88345) 2024-03-19 16:19:52 +01:00
tnoel requested changes 2024-03-19 16:58:01 +01:00
Dismissed
@ -131,1 +131,4 @@
def check_status(self):
url = urllib.parse.urljoin(self.service_url, 'public/status')
try:
Owner

Pas la peine de faire un try ici, justement, on veut que ça crashe quand ça va pas :)

Tu peux aller sur du super simple :

   url = ...
   response = self.requests.get(url)
   response.raise_for_status()
   if response.text.strip() != 'status: ok':
       raise APIError('status is not ok')
Pas la peine de faire un try ici, justement, on veut que ça crashe quand ça va pas :) Tu peux aller sur du super simple : ``` url = ... response = self.requests.get(url) response.raise_for_status() if response.text.strip() != 'status: ok': raise APIError('status is not ok') ```
yweber marked this conversation as resolved
yweber force-pushed wip/88345-carl-check-status from 3338738767 to bd8f51045a 2024-03-19 17:22:26 +01:00 Compare
yweber requested review from tnoel 2024-03-19 17:28:20 +01:00
tnoel requested changes 2024-03-19 17:56:43 +01:00
Dismissed
@ -132,0 +134,4 @@
response = self.requests.get(url)
response.raise_for_status()
if response.text.strip() != 'status: ok':
raise RuntimeError('Carl status check fails')
Owner

Absolument pas fan de cette exception, utilise la nôtre APIError. (ok, c'est sa fille, mais on la décore comme on veut, je préfère)

Absolument pas fan de cette exception, utilise la nôtre APIError. (ok, c'est sa fille, mais on la décore comme on veut, je préfère)
Author
Owner

Ok, moi aussi je préfère à priori, mais je n'étais pas certain qu'elle soit pertinente ici :)

Ok, moi aussi je préfère à priori, mais je n'étais pas certain qu'elle soit pertinente ici :)
yweber marked this conversation as resolved
yweber force-pushed wip/88345-carl-check-status from bd8f51045a to 134133efa1 2024-03-19 18:04:54 +01:00 Compare
yweber force-pushed wip/88345-carl-check-status from 134133efa1 to 41d84e3dd2 2024-03-19 18:06:57 +01:00 Compare
yweber requested review from tnoel 2024-03-19 18:10:18 +01:00
tnoel approved these changes 2024-03-21 09:57:38 +01:00
yweber force-pushed wip/88345-carl-check-status from 41d84e3dd2 to b5ccfb60ff 2024-03-21 10:33:21 +01:00 Compare
yweber merged commit b5ccfb60ff into main 2024-03-21 10:41:58 +01:00
yweber deleted branch wip/88345-carl-check-status 2024-03-21 10:41:58 +01:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: entrouvert/passerelle#498
No description provided.