Project

General

Profile

Actions

CompressPdf #975

open

Implement Timeout for Long-Running Compression Process in API

Added by Zahid Hassan over 1 year ago. Updated over 1 year ago.

Status:
To Do
Priority:
High
Assignee:
Category:
poc
Target version:
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

  1. 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.
  2. 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.
  3. 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 Timeout error 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 Timeout status with a clear error message if the timeout occurs.
Actions

Also available in: Atom PDF