utils.py 214 B

123456789101112
  1. import logging
  2. import os
  3. import sys
  4. logger = logging.getLogger(__name__)
  5. def is_stopped():
  6. f = ".stop"
  7. if os.path.exists(f):
  8. logger.warning("file %s exists, will be exit", f)
  9. sys.exit(0)