Skip to content

Commit 4f98ec4

Browse files
authored
Adds session token to endpoint (#49)
1 parent 706cf5e commit 4f98ec4

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

app.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,14 @@ def save_tokenizer_as_pickle(request: SaveTokenizer) -> responses.PlainTextRespo
9595
def rework_markdown_file_content(
9696
org_id: str, file_id: str, step: str
9797
) -> responses.Response:
98-
if not markdown_file_content.rework_markdown_file_content(
99-
org_id, file_id, step.upper()
100-
):
98+
session_token = general.get_ctx_token()
99+
try:
100+
r = markdown_file_content.rework_markdown_file_content(
101+
org_id, file_id, step.upper()
102+
)
103+
finally:
104+
general.remove_and_refresh_session(session_token)
105+
if not r:
101106
return responses.Response(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR)
102107
return responses.Response(status_code=status.HTTP_200_OK)
103108

0 commit comments

Comments
 (0)