示例#1
0
def clean_global_runtime_state(reset_subsystem=False):
    """Resets the global runtime state of a pants runtime for cleaner forking.

  :param bool reset_subsystem: Whether or not to clean Subsystem global state.
  """
    if reset_subsystem:
        # Reset subsystem state.
        Subsystem.reset()

    # Reset Goals and Tasks.
    Goal.clear()

    # Reset backend/plugins state.
    OptionsInitializer.reset()
示例#2
0
文件: util.py 项目: benjyw/pants
def clean_global_runtime_state(reset_subsystem=False):
  """Resets the global runtime state of a pants runtime for cleaner forking.

  :param bool reset_subsystem: Whether or not to clean Subsystem global state.
  """
  if reset_subsystem:
    # Reset subsystem state.
    Subsystem.reset()

  # Reset Goals and Tasks.
  Goal.clear()

  # Reset backend/plugins state.
  OptionsInitializer.reset()
示例#3
0
文件: util.py 项目: lahosken/pants
def clean_global_runtime_state(reset_runtracker=True, reset_subsystem=False):
    """Resets the global runtime state of a pants runtime for cleaner forking.

  :param bool reset_runtracker: Whether or not to clean RunTracker global state.
  :param bool reset_subsystem: Whether or not to clean Subsystem global state.
  """
    if reset_runtracker:
        # Reset RunTracker state.
        RunTracker.global_instance().reset(reset_options=False)

    if reset_subsystem:
        # Reset subsystem state.
        Subsystem.reset()

    #TODO: Think of an alternative for IntermediateTargetFactoryBase._targets to avoid this call
    IntermediateTargetFactoryBase.reset()

    # Reset Goals and Tasks.
    Goal.clear()

    # Reset backend/plugins state.
    OptionsInitializer.reset()