示例#1
0
文件: signals.py 项目: mkasie/selena
def precache_sla(sender, **kwargs):
    """Make sure the SLA cache exists after the service is saved."""
    service = kwargs['instance']
    if len(SlaCache.objects.filter(service_id=service.id)) == 0:
        # new service - let's generate the cache...
        from services.sla import get_slacache
        slacache = get_slacache(service)
        slacache.save()

        # ...and trigger an initial status check
        from services.monitoring import test_service
        test_service(service)
示例#2
0
def _monitor_service(service):
    test_service(service)
示例#3
0
文件: tasks.py 项目: allegro/selena
def _monitor_service(service):
    test_service(service)