Ejemplo n.º 1
0
    def gen_scan_request_id(self):
        """
        生成扫描请求的id,并写入http header的scan-request-id字段

        Returns:
            str, 生成的id
        """
        uuid = common.generate_uuid()
        scan_id = self.queue_id + "-" + uuid
        self.http_data["headers"]["scan-request-id"] = scan_id
        return scan_id
Ejemplo n.º 2
0
 def __init__(self):
     self.uuid = common.generate_uuid()
     self.read_lock = multiprocessing.Lock()
     self.write_lock = multiprocessing.Lock()
     self.pipe_receiver, self.pip_sender = multiprocessing.Pipe(False)