Beispiel #1
0
 def insert_job_info(self, job):
     job = int(job)
     cmd = "INSERT INTO job_info (version, job, md5s, lcas, updated_on, loaded) VALUES (?, ?, ?, ?, ?, ?)"
     rmqLogger(self.channel, 'insert', cmd)
     insert = cql.BoundStatement(
         self.session.prepare(cmd),
         consistency_level=cql.ConsistencyLevel.QUORUM
     ).bind([self.version, job, 0, 0, datetime.datetime.now(), False])
     self.session.execute(insert)
Beispiel #2
0
 def set_loaded(self, job, loaded):
     job = int(job)
     value = True if loaded else False
     cmd = "UPDATE job_info SET loaded = ?, updated_on = ? WHERE version = ? AND job = ?"
     rmqLogger(self.channel, 'update', cmd)
     update = cql.BoundStatement(
         self.session.prepare(cmd),
         consistency_level=cql.ConsistencyLevel.QUORUM).bind(
             [value, datetime.datetime.now(), self.version, job])
     self.session.execute(update)