Skip to content

Use actions to wait for async tasks completion #105

@jooola

Description

@jooola

What feature do you want to see added?

I noticed that this plugin is not waiting for actions (Hetzner Cloud API async task) to be completed, instead the plugin relies on fetching e.g. server over and over until something has changed.

This leads to users being rate limited by our API, and may introduce a lot of errors while performing changes (e.g. locking) which in turn requires to retry a lot request and hitting the rate limits again. Also, sometimes a new change (action) may only be performed once the previous change (action) is completed.

Note that our API has a different rate limit for actions than for other endpoints. This is because we expect users to wait for actions to complete by calling the actions endpoint more than the other, more expensive, resource endpoints. You should leverage that to reduce the chances to run into rate limits.

I recommend you to implement a actions wait function similar to:

This will allow you to wait for the actions returned by e.g. the create server endpoint, instead of calling /servers/<id> repeatedly. This applies for all of the API resources that returns actions.

Upstream changes

No response

Are you interested in contributing this feature?

No, but I am happy to answer additional questions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Enhancement.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions