Actions
CompressPdf #975
openImplement Timeout for Long-Running Compression Process in API
Start date:
11/12/2024
Due date:
11/12/2024 (about 17 months late)
% Done:
100%
Estimated time:
2:00 h
Spent time:
Description
Description¶
A Proof of Concept (PoC) has been conducted to implement a timeout mechanism for long-running compression processes in the API. If the compression process exceeds 30 seconds, the API will automatically exit the function and return a timeout error to the user. This feature ensures that the API remains responsive and prevents prolonged execution times.
Scope of Work¶
-
Implement Timeout Mechanism
- Integrate the timeout functionality for compression processes within the API function.
- If the compression exceeds 30 seconds, the function should exit, and the API should return a timeout error.
-
Error Handling
- Return an appropriate timeout error response (HTTP status code
408 Request Timeout) if the process exceeds the 30-second limit. - Include a clear error message indicating that the process took too long to complete.
- Return an appropriate timeout error response (HTTP status code
-
Testing
- Test the timeout functionality with various compression tasks to confirm it exits after 30 seconds.
- Test to ensure normal compression complete successfully within the time limit.
- Verify that the API responds correctly with a
408 Request Timeouterror and message when the process time limit is exceeded.
Acceptance Criteria¶
- The compression process exits and returns a timeout error if it runs for more than 30 seconds.
- The API returns a
408 Request Timeoutstatus with a clear error message if the timeout occurs.
Actions