Example #1
0
    def check_celery(self, request):
        try:
            investigator = check_celery.delay()
        except socket_error as e:
            messages.error(request, 'Cannot connect to broker: %s' % e)
            return HttpResponseRedirect(reverse('admin:users_userprofile_changelist'))

        try:
            investigator.get(timeout=5)
        except investigator.TimeoutError as e:
            messages.error(request, 'Worker timeout: %s' % e)
        except Exception as e:
            raise e
        else:
            messages.success(request, 'Celery is OK')

        return HttpResponseRedirect(reverse('admin:users_userprofile_changelist'))
Example #2
0
    def check_celery(self, request):
        try:
            investigator = check_celery.delay()
        except socket_error as e:
            messages.error(request, 'Cannot connect to broker: %s' % e)
            return HttpResponseRedirect(reverse('admin:users_userprofile_changelist'))

        try:
            investigator.get(timeout=5)
        except investigator.TimeoutError as e:
            messages.error(request, 'Worker timeout: %s' % e)
        except Exception as e:
            raise e
        else:
            messages.success(request, 'Celery is OK')

        return HttpResponseRedirect(reverse('admin:users_userprofile_changelist'))