Skip to content

Commit 3d622cf

Browse files
committed
fix: extend library index update interval to 60 seconds for improved performance
1 parent 38b5c12 commit 3d622cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/orchestrator/sketch_libs.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
"github.com/arduino/arduino-app-cli/internal/orchestrator/app"
2929
)
3030

31-
const indexUpdateInterval = 1 * time.Second // TODO change to a better value
31+
const indexUpdateInterval = 60 * time.Second
3232

3333
func AddSketchLibrary(ctx context.Context, app app.ArduinoApp, libRef LibraryReleaseID, addDeps bool) ([]LibraryReleaseID, error) {
3434
srv := commands.NewArduinoCoreServer()
@@ -54,7 +54,7 @@ func AddSketchLibrary(ctx context.Context, app app.ArduinoApp, libRef LibraryRel
5454
})
5555
req := &rpc.UpdateLibrariesIndexRequest{Instance: inst, UpdateIfOlderThanSecs: int64(indexUpdateInterval.Seconds())}
5656
if err := srv.UpdateLibrariesIndex(req, stream); err != nil {
57-
//TODO: only print a warn message instead of failing ? in order to avoid blocking the user to instal lthe lib in case it is present into the local index
57+
// TODO: only print a warn message instead of failing ? in order to avoid blocking the user to install the lib in case it is present into the local index
5858
return []LibraryReleaseID{}, fmt.Errorf("error updating library index: %v", err)
5959
}
6060
slog.Debug("Library index update", "status", res().GetLibrariesIndex().GetStatus())

0 commit comments

Comments
 (0)