__init__.py 458 B

12345678910111213141516171819202122
  1. # -*- coding: utf-8 -*-
  2. # !/usr/bin/env python
  3. import signal
  4. from django.core.cache import caches
  5. serviceCache = caches['service']
  6. reportCache = caches['report']
  7. lockCache = caches['lock']
  8. def handle_usr1(sig, frame):
  9. from apps.web.core.models import SystemSettings
  10. SystemSettings.reload_settings()
  11. def init_signals():
  12. if hasattr(signal, "SIGUSR1"):
  13. signal.signal(signal.SIGUSR1, handle_usr1)
  14. init_signals()