Changeset View
Changeset View
Standalone View
Standalone View
swh/fuse/fuse.py
Show First 20 Lines • Show All 210 Lines • ▼ Show 20 Lines | async with FuseCache(conf["cache"]) as cache: | ||||
# Initially populate the cache | # Initially populate the cache | ||||
for swhid in swhids: | for swhid in swhids: | ||||
await fs.get_metadata(swhid) | await fs.get_metadata(swhid) | ||||
fuse_options = set(pyfuse3.default_options) | fuse_options = set(pyfuse3.default_options) | ||||
fuse_options.add("fsname=swhfs") | fuse_options.add("fsname=swhfs") | ||||
fuse_options.add("debug") | fuse_options.add("debug") | ||||
pyfuse3.init(fs, root_path, fuse_options) | |||||
try: | try: | ||||
pyfuse3.init(fs, root_path, fuse_options) | |||||
await pyfuse3.main() | await pyfuse3.main() | ||||
except Exception as e: | |||||
logging.error(f"Error running FUSE: {e}") | |||||
finally: | finally: | ||||
fs.shutdown() | fs.shutdown() | ||||
pyfuse3.close(unmount=True) | pyfuse3.close(unmount=True) |