def check_status(self):
     try:
         result = add.apply_async(args=[4, 4], expires=datetime.now() + timedelta(seconds=3), connect_timeout=3)
         now = datetime.now()
         while (now + timedelta(seconds=3)) > datetime.now():
             if result.result == 8:
                 return True
             sleep(0.5)
     except IOError:
         pass
     raise ServiceUnavailable("Unknown error")
 def check_status(self):
     try:
         result = add.apply_async(args=[4,4], expires=datetime.now() + timedelta(seconds=3), connect_timeout=3)
         now = datetime.now()
         while (now + timedelta(seconds=3)) > datetime.now():
             if result.result == 8:
                 return HealthCheckStatusType.working
             sleep(0.5)
     except IOError:
         pass
     return HealthCheckStatusType.unavailable
    def check_status(self):
        timeout = getattr(settings, 'HEALTHCHECK_CELERY_TIMEOUT', 3)

        try:
            result = add.apply_async(args=[4, 4], expires=datetime.now() + timedelta(seconds=timeout), connect_timeout=timeout)
            now = datetime.now()
            while (now + timedelta(seconds=3)) > datetime.now():
                if result.result == 8:
                    return True
                sleep(0.5)
        except IOError:
            pass
        raise ServiceUnavailable("Unknown error")
 def check_status(self):
     try:
         result = add.apply_async(args=[4, 4],
                                  expires=datetime.now() +
                                  timedelta(seconds=3),
                                  connect_timeout=3)
         now = datetime.now()
         while (now + timedelta(seconds=3)) > datetime.now():
             if result.result == 8:
                 return True
             sleep(0.5)
     except IOError:
         pass
     raise ServiceUnavailable("Unknown error")
Example #5
0
 def check_status(self):
     try:
         result = add.apply_async(args=[4, 4],
                                  expires=datetime.now() +
                                  timedelta(seconds=3),
                                  connect_timeout=3)
         now = datetime.now()
         while (now + timedelta(seconds=3)) > datetime.now():
             if result.result == 8:
                 return HealthCheckStatusType.working
             sleep(0.5)
     except IOError:
         pass
     return HealthCheckStatusType.unavailable
 def check_status(self):
     timeout = getattr(settings, 'HEALTHCHECK_CELERY_TIMEOUT', 3)
     expires = datetime.now() + timedelta(seconds=timeout)
     try:
         result = add.apply_async(args=[4, 4],
                                  expires=expires,
                                  connect_timeout=timeout)
         now = datetime.now()
         while (now + timedelta(seconds=3)) > datetime.now():
             if result.result == 8:
                 return True
             sleep(0.5)
     except IOError:
         pass
     raise ServiceUnavailable("Unknown error")