-
Notifications
You must be signed in to change notification settings - Fork 2
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
ARXIVCE-2614 Create remote converter driver #66
Conversation
59d7dbb
to
793c516
Compare
5d131e6
to
b1dd0ef
Compare
5a5d46a
to
6f8bf0c
Compare
23c62d4
to
a8dfb43
Compare
f479ab7
to
3353f4a
Compare
|
||
|
||
def submit_tarball(service: str, tarball: str, outcome_file: str, tex2pdf_timeout: int, post_timeout: int, auto_detect: bool = False) -> bool: | ||
"""Submit tarball to compilation service.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Naming discussion]
The submit
verb is a bit loaded due to the arXiv "submission" process, which gets me a little confused. If you're only thinking of message passing here, how about send_tarball
?
But I see that the function does the web request and handles the response, so this is the "full work". Maybe then process_tarball
is even better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it to service_process_tarball
, since process_tarball
itself again has the same problem ;-)
|
||
with open(tarball, "rb") as data_fd: | ||
uploading = {"incoming": (os.path.basename(tarball), data_fd, "application/gzip")} | ||
while True: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while True
may be inviting an infinite loop during the worst of times (some DDoS 504 situation). How about the retry pattern of:
retries = 2
for attempt in range(1+retries):
# do work
or some variation on that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I don't know why there is this special case for 504 error anyway ... @ntai ?
(I stumbled over the retries = 2 .... range(1+retries)
until I realized it is retries and not tries = 2
;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
compile_submissions
intoa new module
remote_call
remote_call
incompile_submissions
scriptgenerate_pdf
resuing the
remote_call
facilities