

def sigterm_handler(self, signo, stack_frame):
    self.termed = True
    if self.in_job:
        logger.info('Shutdown signal received while busy, waiting for loop termination')
    else:
        logger.info('Shutdown signal received while idle, terminating immediately')
        sys.exit(0)

dataset/ETHPy150Open andrewgodwin/channels/channels/worker.py Worker.sigterm_handler/original