Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Met à jour Sentry et corrige un avertissement #6623

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements-prod.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

gunicorn==21.2.0
mysqlclient==2.2.4
sentry-sdk==1.41.0
sentry-sdk==2.9.0
ujson==5.9.0
11 changes: 0 additions & 11 deletions zds/tutorialv2/publication_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,10 +461,6 @@ def tex_compiler(self, texfile, draftmode: str = ""):
)
# let's put 10 min of timeout because we do not generate latex everyday
command_process.communicate(timeout=600)
with contextlib.suppress(ImportError):
import sentry_sdk

sentry_sdk.add_breadcrumb(message="lualatex call", data=command, type="cmd")

pdf_file_path = path.splitext(texfile)[0] + self.extension
return path.exists(pdf_file_path)
Expand All @@ -475,10 +471,7 @@ def make_glossary(self, basename, texfile):
command, shell=True, cwd=path.dirname(texfile), stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
std_out, std_err = command_process.communicate()
with contextlib.suppress(ImportError):
import sentry_sdk

sentry_sdk.add_breadcrumb(message="makeglossaries call", data=command, type="cmd")
# TODO: check makeglossary exit codes to see if we can enhance error detection
if "fatal" not in std_out.decode("utf-8").lower() and "fatal" not in std_err.decode("utf-8").lower():
return True
Expand All @@ -504,10 +497,6 @@ def handle_tex_compiler_error(latex_file_path, ext):

errors = "\n".join(lines)
logger.debug("%s ext=%s", errors, ext)
with contextlib.suppress(ImportError):
import sentry_sdk

sentry_sdk.add_breadcrumb(message="luatex call", data=errors, type="cmd")

raise FailureDuringPublication(errors)

Expand Down