Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f5a4c7d

Browse files
author
Luca Bianconi
committed
docs: describe new configuration variables
1 parent 0710afa commit f5a4c7d

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

‎commands/compile/compile.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ func maybePurgeBuildCache() {
291291
}
292292
inventory.Store.Set("build_cache.compilation_count_since_last_purge", 0)
293293

294-
cacheTTL := configuration.Settings.GetDuration("build_cache.ttl")
294+
cacheTTL := configuration.Settings.GetDuration("build_cache.ttl").Abs()
295295
buildcache.Purge(paths.TempDir().Join("arduino", "cores"), cacheTTL)
296296
buildcache.Purge(paths.TempDir().Join("arduino", "sketches"), cacheTTL)
297297
}

‎configuration/defaults.go‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package configuration
1717

1818
import (
19+
"fmt"
1920
"path/filepath"
2021
"strings"
2122
"time"
@@ -69,4 +70,6 @@ func SetDefaults(settings *viper.Viper) {
6970
settings.BindEnv("directories.Downloads", "ARDUINO_DOWNLOADS_DIR")
7071
settings.BindEnv("directories.Data", "ARDUINO_DATA_DIR")
7172
settings.BindEnv("sketch.always_export_binaries", "ARDUINO_SKETCH_ALWAYS_EXPORT_BINARIES")
73+
fmt.Println(settings.GetDuration("build_cache.ttl"))
74+
panic(false)
7275
}

‎docs/configuration.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
to the sketch folder. This is the equivalent of using the [`--export-binaries`][arduino-cli compile options] flag.
3434
- `updater` - configuration options related to Arduino CLI updates
3535
- `enable_notification` - set to `false` to disable notifications of new Arduino CLI releases, defaults to `true`
36+
- `build_cache` configuration options related to the compilation cache
37+
- `compilations_before_purge` - interval, in number of compilations, at which the cache is purged, defaults to `10`.
38+
When `0` the cache is never purged.
39+
- `ttl` - cache expiration time of build folders. If the cache is hit by a compilation the corresponding build files
40+
lifetime is renewed. The value format must be a valid input for
41+
[time.ParseDuration()](https://pkg.go.dev/time#ParseDuration), defaults to `720h` (30 days).
3642

3743
## Configuration methods
3844

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /