Scheduled API
- Asynchronous task execution: The module utilizes Frappe's background job system to enqueue and execute tasks asynchronously.
- Schedule Request processing: The module processes "Schedule Request" documents and determines whether to create a new document or call a specified method based on the request.
- Error handling and retries: The module gracefully handles exceptions during request execution, updates the status accordingly, and retries failed requests.
- Schedule Response creation: The module creates "Schedule Response" documents based on the outcome of the request execution, including success, errors, and traceback information.
- Callback URL support: The module supports sending responses to specified callback URLs, with configurable headers and automatic retries upon failure.
- Pending and Failed request processing: The module provides a function to process all pending and failed "Schedule Request" documents, allowing for easier recovery and rescheduling.
- Modular design: The module is organized into separate functions for enqueueing, executing, and sending responses, which promotes readability and maintainability.
These features collectively enable the module to handle scheduled API requests effectively, manage their execution and responses, and provide a robust mechanism for communication with external systems.
MIT