create --no-cache-sync-forced option

when given, force using the AdHocCache.
This commit is contained in:
Thomas Waldmann 2023-09-21 23:28:30 +02:00
parent de342581d6
commit 98162fbb42
No known key found for this signature in database
GPG Key ID: 243ACFA951F78E01
2 changed files with 11 additions and 0 deletions

View File

@ -225,6 +225,7 @@ class CreateMixIn:
progress=args.progress,
lock_wait=self.lock_wait,
permit_adhoc_cache=args.no_cache_sync,
force_adhoc_cache=args.no_cache_sync_forced,
cache_mode=args.files_cache_mode,
iec=args.iec,
) as cache:
@ -803,6 +804,12 @@ class CreateMixIn:
action="store_true",
help="experimental: do not synchronize the cache. Implies not using the files cache.",
)
subparser.add_argument(
"--no-cache-sync-forced",
dest="no_cache_sync_forced",
action="store_true",
help="experimental: do not synchronize the cache (forced). Implies not using the files cache.",
)
subparser.add_argument(
"--stdin-name",
metavar="NAME",

View File

@ -413,6 +413,7 @@ class Cache:
progress=False,
lock_wait=None,
permit_adhoc_cache=False,
force_adhoc_cache=False,
cache_mode=FILES_CACHE_MODE_DISABLED,
iec=False,
):
@ -431,6 +432,9 @@ class Cache:
def adhoc():
return AdHocCache(manifest=manifest, lock_wait=lock_wait, iec=iec)
if force_adhoc_cache:
return adhoc()
if not permit_adhoc_cache:
return local()