def _maybe_launch_pantsd(self): """Launches pantsd if configured to do so.""" if self._global_options.enable_pantsd: # Avoid runtracker output if pantsd is disabled. Otherwise, show up to inform the user its on. with self._run_tracker.new_workunit(name='pantsd', labels=[WorkUnitLabel.SETUP]): PantsDaemonLauncher.global_instance().maybe_launch()
def pantsd(): """Launches pantsd with a LocalScheduler instance for testing.""" scheduler = setup()[0] pantsd_launcher = PantsDaemonLauncher.global_instance() pantsd_launcher.set_scheduler(scheduler) print('*** pantsd {} ***'.format('running' if pantsd_launcher.pantsd.is_alive() else 'launched')) pantsd_launcher.maybe_launch()
def _maybe_launch_pantsd(self): """Launches pantsd if configured to do so.""" if self._global_options.enable_pantsd: # Avoid runtracker output if pantsd is disabled. Otherwise, show up to inform the user its on. with self._run_tracker.new_workunit(name="pantsd", labels=[WorkUnitLabel.SETUP]): PantsDaemonLauncher.global_instance().maybe_launch()
def execute(self): try: PantsDaemonLauncher.global_instance().terminate() except ProcessManager.NonResponsiveProcess as e: raise TaskError("failure while terminating pantsd: {}".format(e))
def maybe_launch_pantsd(options, scheduler): if options.for_global_scope().enable_pantsd is True: pantsd_launcher = PantsDaemonLauncher.global_instance() pantsd_launcher.set_scheduler(scheduler) pantsd_launcher.maybe_launch()
def execute(self): try: PantsDaemonLauncher.global_instance().terminate() except ProcessManager.NonResponsiveProcess as e: raise TaskError('failure while terminating pantsd: {}'.format(e))