diff --git a/internal/manager/device_manager.go b/internal/manager/device_manager.go index 9eb6f0d..f3c9575 100644 --- a/internal/manager/device_manager.go +++ b/internal/manager/device_manager.go @@ -55,7 +55,8 @@ func (dm *DeviceManager) GetDeviceByUDID(udid string) (*model.Device, bool) { func (dm *DeviceManager) AppendProductInfo(dev *model.Device) { timeout := 10 * time.Second - ctx, _ := context.WithTimeout(context.Background(), timeout) + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() cmd := exec.CommandContext(ctx, "ideviceinfo", "-u", dev.UDID, "-n") cmd.Dir = app.Config.Server.DataDir output, err := cmd.CombinedOutput()