def __call__(self):
status = 1
with log_exception(status=1):
args = self.parser.parse_args()
log_args(args)
config.log_cached()
logger = getLogger('django')
with ExitStack() as stack:
if self._pid_file:
stack.enter_context(pid_file(dirname=config.PID_DIR, max_age=self._pid_file_max_age))
if self._stoppable:
self._stoppable_instance = stoppable()
stack.enter_context(self._stoppable_instance)
status = self.run(args, logger) or 0
sys.exit(status)
评论列表
文章目录