Skip to content

Commit 7c69e44

Browse files
committed
update lib index during update
1 parent 51dab70 commit 7c69e44

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

internal/update/arduino/arduino.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,15 @@ func (a *ArduinoPlatformUpdater) ListUpgradablePackages(ctx context.Context, _ f
8282
return nil, err
8383
}
8484

85+
streamLibIndex, _ := commands.UpdateLibrariesIndexStreamResponseToCallbackFunction(ctx, func(curr *rpc.DownloadProgress) {
86+
slog.Debug("downloading library index", "progress", curr.GetMessage())
87+
})
88+
89+
req := &rpc.UpdateLibrariesIndexRequest{Instance: inst, UpdateIfOlderThanSecs: 0}
90+
if err := srv.UpdateLibrariesIndex(req, streamLibIndex); err != nil {
91+
slog.Warn("error updating library index, skipping", slog.String("error", err.Error()))
92+
}
93+
8594
if err := srv.Init(
8695
&rpc.InitRequest{Instance: inst},
8796
commands.InitStreamResponseToCallbackFunction(ctx, func(r *rpc.InitResponse) error {

0 commit comments

Comments
 (0)