Example #1
0
        def wrapper(self, *args, **kwargs):
            """ Call wrapped function getting cid from RPC call """
            cid = kwargs.pop("cid", str(uuid4()))

            locals.set_cid(cid)

            return function(self, *args, **kwargs)
Example #2
0
 def wrapper(self, cid, *args, **kwargs):
     """ Call wrapped function getting cid from RPC call """
     locals.set_cid(cid)
     return function(self, *args, **kwargs)
Example #3
0
 def test_set_cid(self):
     self.assertIsNone(get_cid())
     set_cid(self.cid)
     self.assertEqual(self.cid, get_cid())
Example #4
0
 def _process_request(self, request):
     upstream_cid = request.META.get(self.cid_request_header, None)
     cid = generate_new_cid(upstream_cid)
     request.correlation_id = cid
     set_cid(cid)
     return request
Example #5
0
 def _process_request(self, request):
     upstream_cid = request.META.get(self.cid_request_header, None)
     cid = generate_new_cid(upstream_cid)
     request.correlation_id = cid
     set_cid(cid)
     return request
Example #6
0
 def test_set_cid(self):
     self.assertIsNone(get_cid())
     set_cid(self.cid)
     self.assertEqual(self.cid, get_cid())
Example #7
0
        def wrapper(self, event_data):
            """ Function wrapper """
            # get the CID off of the event data and set it on the local thread
            locals.set_cid(event_data.pop("cid"))

            return function(self, event_data)