色婷婷狠狠18禁久久YY,CHINESE性内射高清国产,国产女人18毛片水真多1,国产AV在线观看

如何用ansible+python實(shí)現(xiàn)一個(gè)定時(shí)將數(shù)據(jù)插入influxdb數(shù)據(jù)庫(kù)?

classBuffer(object):MAXSIZE=8192def__init__(self,conn,sql):self.conn=connself.sql=sqlself.buffer=[]defappend(self,data):self.buffer.append(data)iflen(self.buffer)>self.MAXSIZE:self.flush()defflush(self):data,self.buffer=self.buffer,[]curr=self.conn.cursor()curr.executemany(self.sql,data)self.conn.commit()#hereareyourcodeforinitdatabaseconnectconn_srcandconn_store...buff=Buffer(conn_store,"insertintosybase_uservalues(%s,%s)")sql_query="selecta.id,a.namefromuser_infoawherea.id=%s"curr_src=conn_src.cursor()curr_src.execute(sql_query,'0001')forrowincurr_src:buff.append(row)buff.flush()