MCPcopy Create free account
hub / github.com/Tencent/CodeAnalysis / get

Method get

server/projects/analysis/apps/base/apis.py:48–61  ·  view source on GitHub ↗
(self, request)

Source from the content-addressed store, hash-verified

46 permission_classes = []
47
48 def get(self, request):
49 logger.info("[AnalysisServerHealthCheck] Step 1: check db connection and orm operation")
50 try:
51 User.objects.all()
52 except Exception as e:
53 logger.info("[AnalysisServerHealthCheck] step 1 failed, err msg: %s" % e)
54 return HttpResponse("DB connection or orm raise exception", status=status.HTTP_503_SERVICE_UNAVAILABLE)
55
56 logger.info("[AnalysisServerHealthCheck] Step 2: check celery status and asynchronous tasks")
57 file_name = request.GET.get("file_name", None)
58 if file_name:
59 server_health_check.delay(file_name)
60
61 return HttpResponse("analysis server status check success", status=status.HTTP_200_OK)

Callers

nothing calls this directly

Calls 3

infoMethod · 0.45
allMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected