Merge pull request #7 from PlasmaPower/close-protobuf

Close the protobuf session on shutdown
This commit is contained in:
Daniel Dakhno 2023-04-24 10:25:42 +02:00 committed by GitHub
commit 5d756b54eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 0 deletions

View File

@ -143,5 +143,9 @@ class FlipperAPI():
with self.mutex:
self._cmd_storage_write(path, data)
def close(self):
with self.mutex:
self.proto.cmd_flipper_stop_session()
class InvalidNameError(RuntimeError):
pass

View File

@ -189,3 +189,6 @@ class FlipperZeroFileSystem(fuse.Operations, fuse.LoggingMixIn):
cached = self.get_file_by_path(path)
self.api.delete(path, True)
cached['parent']['children'].remove(cached)
def close(self):
self.api.close()

View File

@ -55,6 +55,7 @@ def main():
fuse.FUSE(backend, args.mountpoint, foreground=True)
print('fuse stopped')
backend.close()
flsrl.close()
if __name__ == '__main__':