Skip to content

Task time limit #1122

Answered by ewjoachim
scttnlsn asked this question in Q&A
Jul 20, 2024 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

If the task is async, that's supposedly easily achievable with asyncio.wait_for.
If the task is sync, it's going to be more complicated. From what I can say, the 2 options are the subprocess (as you mentionned) or a signal handler on SIGALARM (and I have no idea whether this plays nicely with threads, given sync code is executed in threads.)

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@ewjoachim
Comment options

@TkTech
Comment options

@ewjoachim
Comment options

@scttnlsn
Comment options

Answer selected by scttnlsn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants