diff options
author | Jürg Billeter <j@bitron.ch> | 2019-09-02 12:12:50 +0200 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2019-09-03 11:17:28 +0200 |
commit | df3000b05fd1b8f65289b3b0fbf476a19ef61869 (patch) | |
tree | d0f937625962c9b9d15da3d4d0ef50bd21440860 | |
parent | d6c667a936f250fd6497d553cc8d447b84314929 (diff) | |
download | buildstream-df3000b05fd1b8f65289b3b0fbf476a19ef61869.tar.gz |
cascache.py: Add has_open_grpc_channels() method
-rw-r--r-- | src/buildstream/_cas/cascache.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/buildstream/_cas/cascache.py b/src/buildstream/_cas/cascache.py index af69e3d68..831229fe8 100644 --- a/src/buildstream/_cas/cascache.py +++ b/src/buildstream/_cas/cascache.py @@ -136,6 +136,14 @@ class CASCache(): if not (os.path.isdir(headdir) and os.path.isdir(objdir)): raise CASCacheError("CAS repository check failed for '{}'".format(self.casdir)) + # has_open_grpc_channels(): + # + # Return whether there are gRPC channel instances. This is used to safeguard + # against fork() with open gRPC channels. + # + def has_open_grpc_channels(self): + return bool(self._casd_channel) + # notify_fork_disabled(): # # Called by Context when fork() is disabled. This will enable communication |