You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we initiate a snapshot operation, we get an integer back from the API. BUT, that integer is not the id of the snapshot. Digital Ocean does not return the snapshot id until the operation is over. Instead, the ID has to be used to poll the DO api to get the status of the snapshot and then obtain its [the snapshot] id after the operation is complete.
Proposed Solution
After the snapshot operation is initiated, add a task to our background task table (aka the pending logs CPT).
We will need to add a corresponding action hook to the DO provider to handle querying the DO api for the status of the operation. If the operation is still in progress we'll need to re-add the task into the background task table and keep doing that until the operation is complete.
One issue here is that we'll be querying the DO api at least once per minute per snapshot. If we do not want to do this that often, we'll need to add a new feature to the function that scans the background task table and dispatches tasks from it. We will need to modify it to optionally only dispatch a task after a particular date/time is met. This way we can add our tasks to the table with specified future date to be run.
Why don't we use the WP CRON? Ans: We want as many WPCD tasks as possible to be centralized and monitored in one location.
Why We Need This
We can start to store the IDs of snapshots in our own tables so that we can then allow for on-demand or scheduled deletions.
Primary Files Affected
core/providers/class-digital-ocean-parent.php
The text was updated successfully, but these errors were encountered:
Have to put this on hold because DO's api does not actually provide the data we need to get the status of a snapshot that was requested via the API. It's a hole in the API for snapshots but DO has not committed to a fix.
Introduction
When we initiate a snapshot operation, we get an integer back from the API. BUT, that integer is not the id of the snapshot. Digital Ocean does not return the snapshot id until the operation is over. Instead, the ID has to be used to poll the DO api to get the status of the snapshot and then obtain its [the snapshot] id after the operation is complete.
Proposed Solution
After the snapshot operation is initiated, add a task to our background task table (aka the pending logs CPT).
We will need to add a corresponding action hook to the DO provider to handle querying the DO api for the status of the operation. If the operation is still in progress we'll need to re-add the task into the background task table and keep doing that until the operation is complete.
One issue here is that we'll be querying the DO api at least once per minute per snapshot. If we do not want to do this that often, we'll need to add a new feature to the function that scans the background task table and dispatches tasks from it. We will need to modify it to optionally only dispatch a task after a particular date/time is met. This way we can add our tasks to the table with specified future date to be run.
Why don't we use the WP CRON? Ans: We want as many WPCD tasks as possible to be centralized and monitored in one location.
Why We Need This
We can start to store the IDs of snapshots in our own tables so that we can then allow for on-demand or scheduled deletions.
Primary Files Affected
The text was updated successfully, but these errors were encountered: