mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-27 03:21:09 +01:00
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:
@@ -90,14 +90,14 @@ func IsBlacklisted(c *types.Container) bool {
|
||||
return IsBlacklistedImage(c.Image) || isDatabase(c)
|
||||
}
|
||||
|
||||
func UpdatePorts(c *types.Container) error {
|
||||
func UpdatePorts(ctx context.Context, c *types.Container) error {
|
||||
dockerClient, err := NewClient(c.DockerCfg)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer dockerClient.Close()
|
||||
|
||||
inspect, err := dockerClient.ContainerInspect(context.Background(), c.ContainerID)
|
||||
inspect, err := dockerClient.ContainerInspect(ctx, c.ContainerID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user