diff options
author | Angelos Evripiotis <jevripiotis@bloomberg.net> | 2019-07-02 15:01:50 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-07-05 09:44:45 +0000 |
commit | b60fffebf563edfe258cbb893754197af1ac5a0b (patch) | |
tree | 48d7a2bee30f9b9edf6ea825bc9b22c804d38e53 /src/buildstream/_scheduler/jobs/job.py | |
parent | fe632514cb1892da1fe0c0f0c3a4fa3d33a8ec50 (diff) | |
download | buildstream-b60fffebf563edfe258cbb893754197af1ac5a0b.tar.gz |
Refactor: message handlers take 'is_silenced'
Remove the need to pass the Context object to message handlers, by
passing what is usually requested from the context instead.
This paves the way to sharing less information with some child jobs -
they won't need the whole context object, just the messenger.
Diffstat (limited to 'src/buildstream/_scheduler/jobs/job.py')
-rw-r--r-- | src/buildstream/_scheduler/jobs/job.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/buildstream/_scheduler/jobs/job.py b/src/buildstream/_scheduler/jobs/job.py index 51531de64..e970481ab 100644 --- a/src/buildstream/_scheduler/jobs/job.py +++ b/src/buildstream/_scheduler/jobs/job.py @@ -828,16 +828,16 @@ class ChildJob(): # the message back to the parent process for further propagation. # # Args: - # message (Message): The message to log - # context (Context): The context object delegating this message + # message (Message): The message to log + # is_silenced (bool) : Whether messages are silenced # - def _child_message_handler(self, message, context): + def _child_message_handler(self, message, is_silenced): message.action_name = self.action_name message.task_id = self._task_id # Send to frontend if appropriate - if context.silent_messages() and (message.message_type not in unconditional_messages): + if is_silenced and (message.message_type not in unconditional_messages): return if message.message_type == MessageType.LOG: |