docs: first_exist_fallback try policy

This commit is contained in:
Kévin Dunglas 2025-01-09 15:28:36 +01:00
parent dbd9cc7948
commit 61e6f86072
No known key found for this signature in database
GPG key ID: 4D04EBEF06AAF3A6
2 changed files with 5 additions and 3 deletions

View file

@ -300,7 +300,7 @@ respond @api "Hello, API!"
file {
root <path>
try_files <files...>
try_policy first_exist|smallest_size|largest_size|most_recently_modified
try_policy first_exist|first_exist_fallback|smallest_size|largest_size|most_recently_modified
split_path <delims...>
}
file <files...>
@ -308,7 +308,7 @@ file <files...>
expression `file({
'root': '<path>',
'try_files': ['<files...>'],
'try_policy': 'first_exist|smallest_size|largest_size|most_recently_modified',
'try_policy': 'first_exist|first_exist_fallback|smallest_size|largest_size|most_recently_modified',
'split_path': ['<delims...>']
})`
expression file('<files...>')
@ -330,6 +330,8 @@ By files.
- `first_exist` checks for file existence. The first file that exists is selected.
- `first_exist_fallback` is similar to `first_exist`, but assumes that the last element in the list always exists to prevent a disk access.
- `smallest_size` chooses the file with the smallest size.
- `largest_size` chooses the file with the largest size.