Skip to content

Commit

Permalink
fix(language): disable cache by default
Browse files Browse the repository at this point in the history
  • Loading branch information
JanDeDobbeleer committed Nov 17, 2024
1 parent 02e819f commit f1f9217
Show file tree
Hide file tree
Showing 24 changed files with 46 additions and 46 deletions.
2 changes: 1 addition & 1 deletion src/segments/language.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func (l *language) setVersion() error {
l.version.Executable = command.executable

if marchalled, err := json.Marshal(l.version); err == nil {
duration := l.props.GetString(properties.CacheDuration, string(cache.ONEWEEK))
duration := l.props.GetString(properties.CacheDuration, string(cache.NONE))
l.env.Cache().Set(cacheKey, string(marchalled), cache.Duration(duration))
}

Expand Down
46 changes: 23 additions & 23 deletions themes/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@
},
"cache_duration": {
"$ref": "#/definitions/cache_duration",
"default": "168h"
"default": "none"
},
"display_mode": {
"$ref": "#/definitions/display_mode"
Expand Down Expand Up @@ -1497,7 +1497,7 @@
},
"cache_duration": {
"$ref": "#/definitions/cache_duration",
"default": "168h"
"default": "none"
},
"display_mode": {
"$ref": "#/definitions/display_mode"
Expand Down Expand Up @@ -1556,7 +1556,7 @@
},
"cache_duration": {
"$ref": "#/definitions/cache_duration",
"default": "168h"
"default": "none"
},
"display_mode": {
"$ref": "#/definitions/display_mode"
Expand Down Expand Up @@ -1669,7 +1669,7 @@
},
"cache_duration": {
"$ref": "#/definitions/cache_duration",
"default": "168h"
"default": "none"
},
"display_mode": {
"$ref": "#/definitions/display_mode"
Expand Down Expand Up @@ -1722,7 +1722,7 @@
},
"cache_duration": {
"$ref": "#/definitions/cache_duration",
"default": "168h"
"default": "none"
},
"display_mode": {
"$ref": "#/definitions/display_mode"
Expand Down Expand Up @@ -1774,7 +1774,7 @@
},
"cache_duration": {
"$ref": "#/definitions/cache_duration",
"default": "168h"
"default": "none"
},
"display_mode": {
"$ref": "#/definitions/display_mode"
Expand Down Expand Up @@ -1829,7 +1829,7 @@
},
"cache_duration": {
"$ref": "#/definitions/cache_duration",
"default": "168h"
"default": "none"
},
"display_mode": {
"$ref": "#/definitions/display_mode"
Expand Down Expand Up @@ -1884,7 +1884,7 @@
},
"cache_duration": {
"$ref": "#/definitions/cache_duration",
"default": "168h"
"default": "none"
},
"display_mode": {
"$ref": "#/definitions/display_mode"
Expand Down Expand Up @@ -1945,7 +1945,7 @@
},
"cache_duration": {
"$ref": "#/definitions/cache_duration",
"default": "168h"
"default": "none"
},
"display_mode": {
"$ref": "#/definitions/display_mode"
Expand Down Expand Up @@ -1996,7 +1996,7 @@
},
"cache_duration": {
"$ref": "#/definitions/cache_duration",
"default": "168h"
"default": "none"
},
"display_mode": {
"$ref": "#/definitions/display_mode"
Expand Down Expand Up @@ -2157,7 +2157,7 @@
},
"cache_duration": {
"$ref": "#/definitions/cache_duration",
"default": "168h"
"default": "none"
},
"display_mode": {
"$ref": "#/definitions/display_mode"
Expand Down Expand Up @@ -2613,7 +2613,7 @@
},
"cache_duration": {
"$ref": "#/definitions/cache_duration",
"default": "168h"
"default": "none"
},
"display_mode": {
"$ref": "#/definitions/display_mode"
Expand Down Expand Up @@ -3104,7 +3104,7 @@
},
"cache_duration": {
"$ref": "#/definitions/cache_duration",
"default": "168h"
"default": "none"
},
"display_mode": {
"$ref": "#/definitions/display_mode"
Expand Down Expand Up @@ -3521,7 +3521,7 @@
},
"cache_duration": {
"$ref": "#/definitions/cache_duration",
"default": "168h"
"default": "none"
},
"display_mode": {
"$ref": "#/definitions/display_mode"
Expand Down Expand Up @@ -3880,7 +3880,7 @@
},
"cache_duration": {
"$ref": "#/definitions/cache_duration",
"default": "168h"
"default": "none"
},
"display_mode": {
"$ref": "#/definitions/display_mode"
Expand Down Expand Up @@ -4034,7 +4034,7 @@
"properties": {
"cache_duration": {
"$ref": "#/definitions/cache_duration",
"default": "168h"
"default": "none"
}
}
}
Expand Down Expand Up @@ -4063,7 +4063,7 @@
},
"cache_duration": {
"$ref": "#/definitions/cache_duration",
"default": "168h"
"default": "none"
},
"display_mode": {
"$ref": "#/definitions/display_mode"
Expand Down Expand Up @@ -4193,7 +4193,7 @@
},
"cache_duration": {
"$ref": "#/definitions/cache_duration",
"default": "168h"
"default": "none"
},
"display_mode": {
"$ref": "#/definitions/display_mode"
Expand Down Expand Up @@ -4293,7 +4293,7 @@
},
"cache_duration": {
"$ref": "#/definitions/cache_duration",
"default": "168h"
"default": "none"
},
"display_mode": {
"$ref": "#/definitions/display_mode"
Expand Down Expand Up @@ -4356,7 +4356,7 @@
},
"cache_duration": {
"$ref": "#/definitions/cache_duration",
"default": "168h"
"default": "none"
},
"display_mode": {
"$ref": "#/definitions/display_mode"
Expand Down Expand Up @@ -4459,7 +4459,7 @@
},
"cache_duration": {
"$ref": "#/definitions/cache_duration",
"default": "168h"
"default": "none"
},
"display_mode": {
"$ref": "#/definitions/display_mode"
Expand Down Expand Up @@ -4599,7 +4599,7 @@
},
"cache_duration": {
"$ref": "#/definitions/cache_duration",
"default": "168h"
"default": "none"
},
"display_mode": {
"$ref": "#/definitions/display_mode"
Expand Down Expand Up @@ -4814,7 +4814,7 @@
},
"cache_duration": {
"$ref": "#/definitions/cache_duration",
"default": "168h"
"default": "none"
},
"display_mode": {
"$ref": "#/definitions/display_mode"
Expand Down
2 changes: 1 addition & 1 deletion website/docs/segments/languages/crystal.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import Config from "@site/src/components/Config.js";
| ---------------------- | :--------: | :---------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `home_enabled` | `boolean` | `false` | display the segment in the HOME folder or not |
| `fetch_version` | `boolean` | `true` | fetch the crystal version |
| `cache_duration` | `string` | `168h` | the duration for which the version will be cached. The duration is a string in the format `1h2m3s` and is parsed using the [time.ParseDuration] function from the Go standard library. To disable the cache, use `none` |
| `cache_duration` | `string` | `none` | the duration for which the version will be cached. The duration is a string in the format `1h2m3s` and is parsed using the [time.ParseDuration] function from the Go standard library. To disable the cache, use `none` |
| `missing_command_text` | `string` | | text to display when the command is missing |
| `display_mode` | `string` | `context` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when file `extensions` listed are present</li><li>`context`: displays the segment when the environment or files is active</li></ul> |
| `version_url_template` | `string` | | a go [text/template][go-text-template] [template][templates] that creates the URL of the version info / release notes |
Expand Down
2 changes: 1 addition & 1 deletion website/docs/segments/languages/dart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import Config from "@site/src/components/Config.js";
| ---------------------- | :--------: | :-----------------------------------------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `home_enabled` | `boolean` | `false` | display the segment in the HOME folder or not |
| `fetch_version` | `boolean` | `true` | fetch the dart version |
| `cache_duration` | `string` | `168h` | the duration for which the version will be cached. The duration is a string in the format `1h2m3s` and is parsed using the [time.ParseDuration] function from the Go standard library. To disable the cache, use `none` |
| `cache_duration` | `string` | `none` | the duration for which the version will be cached. The duration is a string in the format `1h2m3s` and is parsed using the [time.ParseDuration] function from the Go standard library. To disable the cache, use `none` |
| `missing_command_text` | `string` | | text to display when the command is missing |
| `display_mode` | `string` | `context` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when file `extensions` listed are present</li><li>`context`: displays the segment when the environment or files is active</li></ul> |
| `version_url_template` | `string` | | a go [text/template][go-text-template] [template][templates] that creates the URL of the version info / release notes |
Expand Down
2 changes: 1 addition & 1 deletion website/docs/segments/languages/dotnet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import Config from "@site/src/components/Config.js";
| ---------------------- | :--------: | :----------------------------------------------------------------------------------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `home_enabled` | `boolean` | `false` | display the segment in the HOME folder or not |
| `fetch_version` | `boolean` | `true` | fetch the active version or not; useful if all you need is an icon indicating `dotnet` |
| `cache_duration` | `string` | `168h` | the duration for which the version will be cached. The duration is a string in the format `1h2m3s` and is parsed using the [time.ParseDuration] function from the Go standard library. To disable the cache, use `none` |
| `cache_duration` | `string` | `none` | the duration for which the version will be cached. The duration is a string in the format `1h2m3s` and is parsed using the [time.ParseDuration] function from the Go standard library. To disable the cache, use `none` |
| `missing_command_text` | `string` | | text to display when the command is missing |
| `display_mode` | `string` | `context` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when file `extensions` listed are present</li><li>`context`: displays the segment when the environment or files is active</li></ul> |
| `version_url_template` | `string` | | a go [text/template][go-text-template] [template][templates] that creates the URL of the version info / release notes |
Expand Down
2 changes: 1 addition & 1 deletion website/docs/segments/languages/elixir.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import Config from "@site/src/components/Config.js";
| ---------------------- | :--------: | :-----------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `home_enabled` | `boolean` | `false` | display the segment in the HOME folder or not |
| `fetch_version` | `boolean` | `true` | fetch the elixir version |
| `cache_duration` | `string` | `168h` | the duration for which the version will be cached. The duration is a string in the format `1h2m3s` and is parsed using the [time.ParseDuration] function from the Go standard library. To disable the cache, use `none` |
| `cache_duration` | `string` | `none` | the duration for which the version will be cached. The duration is a string in the format `1h2m3s` and is parsed using the [time.ParseDuration] function from the Go standard library. To disable the cache, use `none` |
| `missing_command_text` | `string` | | text to display when the command is missing |
| `display_mode` | `string` | `context` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when file `extensions` listed are present</li><li>`context`: displays the segment when the environment or files is active</li></ul> |
| `version_url_template` | `string` | | a go [text/template][go-text-template] [template][templates] that creates the URL of the version info / release notes |
Expand Down
Loading

0 comments on commit f1f9217

Please sign in to comment.