refactor: add context handling in various functions

- Modified functions to accept context.Context as a parameter for better context management.
- Updated Init methods in Proxmox and Config to use the provided context.
- Adjusted UpdatePorts and NewProxmoxProvider to utilize the context for operations.
This commit is contained in:
yusing
2026-01-02 17:41:36 +08:00
parent 23ceeda402
commit 65383c7061
5 changed files with 8 additions and 8 deletions

View File

@@ -292,7 +292,7 @@ func (state *state) initProxmox() error {
errs := gperr.NewBuilder()
for _, cfg := range proxmoxCfg {
if err := cfg.Init(); err != nil {
if err := cfg.Init(state.task.Context()); err != nil {
errs.Add(err.Subject(cfg.URL))
}
}